mysql商品表 |
您所在的位置:网站首页 › 商品数据表 › mysql商品表 |
(注:若直接复制上去会报错,可能是标点符号问题,所有标点符号均为英文状态!) 1.商品分类表 创建商品分类表(选择mydb数据库) use mydb; create table sh_good_category( id int unsigned primary key auto_increment comment ‘分类id’, parent_id int unsigned not null default 0 comment’上级分类id’, name varchar(100) not null default’‘comment’名称’, sort int not null default 0 comment’排序’, is_show tinyint unsigned not null default 0 comment’是否显示’, create_time datetime not null default current_timestamp comment’创建时间’, update_time datetime default null comment’更新时间’ ); (注:MySQL5.7以下的版本会出现1067错误,此时应将create_time datetime not null default current_timestamp comment’创建时间’, 改为create_time timestamp not null default current_timestamp comment’创建时间’, 即可。) 添加测试数据 insert into sh_goods_category(id,parent_id,name)values (1,0,‘办公’),(2,1,‘耗材’),(3,2,‘文具’),(4,0,‘电子 |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |