SpringCloud系列
1、建表
--创建数据库
create database `springcloud_sell`;
use springcloud_sell;
--类目
create table `product_category` (
`category_id` int not null auto_increment,
`category_name` varchar(64) not null comment '类目名字',
`category_type` int not null comment '类目编号',
`create_time` timestamp not null default current_timestamp comment '创建时间',
`update_time` timestamp not null default current_timestamp on update current_timestamp comment '修改时间',
primary key(`category_id`),
unique key `uqe_category_type` (`category_type`)
);
insert into `product_category`(`category_id`,`category_name`,`category_type`,`create_time`,`update_time`)
values
(1,'热榜',1,'2018-05-01 12:12:12','2018-05-05 12:12:12'),
(2,'好吃的',2,'2018-05-01 12:12:12','2018-05-05 12:12:12');
--商品
create table `product_info` (
`product_id` varchar(32) not null,
`product_name` varchar(64) not null comment '商品名字',
`product_price` double(8,2) not null comment '商品单价',
`product_stock` int not null comment '商品库存',
`product_description` varchar(64) comment '商品描述',
`product_icon` varchar(512) comment '商品图片',
`product_status` tinyint(3) default '0' comment '商品状态0正常1下架',
`category_type` int not null comment '类目编号',
`create_time` timestamp not null default current_timestamp comment '创建时间',
`update_time` timestamp not null default current_timestamp on update current_timestamp comment '修改时间',
primary key(`product_id`)
);
insert into `product_info`(`product_id`,`product_name`,`product_price`,`product_stock`,`product_description`,
`product_icon`,`product_status`,`category_type`,`create_time`,`update_time`)
values
('13357890893','皮蛋粥',0.01,39,'好吃的皮蛋粥','',0,1,'2018-05-01 12:12:12','2018-05-05 12:12:12'),
('13357835532','慕斯蛋糕',3.01,19,'好吃的慕斯蛋糕','',1,2,'2018-05-01 12:12:12','2018-05-05 12:12:12'),
('13342532330','蜜汁鸡翅',5.01,24,'好吃的蜜汁鸡翅','',0,1,'2018-05-01 12:12:12','2018-05-05 12:12:12');
select * from `product_category`;
select * from `product_info`;

浙公网安备 33010602011771号