-- 准备一张商品分类表(分类ID,分类名称,分类描述)
create table category(
cid int primary key auto_increment,
cname varchar(10),
cdesc varchar(50)
);
-- 准备一张商品表(商品编号,商品名称,商品价格,商品描述,商品分类编号)
create table product(
pid int primary key auto_increment,
pname varchar(10),
price double,
pdesc varchar(50),
cno int
);
-- 数据的准备
insert into category values(null,'手机数码','黑马生产的小手机');
insert into category values(null,'鞋靴箱包','传智生产的包包');
insert into category values(null,'香烟酒水','黄鹤楼,茅台');
insert into category values(null,'馋嘴零食','卫龙辣条,周黑鸭');
insert into product values(null,'锤子',2999,'可以砸榴莲的手机',1);
insert into product values(null,'小米',1599,'为发烧而生',1);
insert into product values(null,'李宁',99,'不走寻常路',2);
insert into product values(null,'耐克',399,'just do it',2);
insert into product values(null,'黄鹤楼',20,'饭后一根烟,胜做活神仙',3);
insert into product values(null,'卫龙辣条',5,'卫龙辣条加料不加价',4);
insert into product values(null,'老干妈辣椒酱',9,'永远不变的味道',4);
insert into product values(null,'老干爹辣椒酱',19,'永远不变的味道',4);
insert into product values(null,'黄鹤楼',20,'饭后一根烟,胜做活神仙',3);