商城数据库建表

商品类型管理:

先要创建商品类型的表,用来存储商品类型的信息。

create table i_type(

      id tinyint unsigned primary key auto_increment,

      type_name varchar(32) not null comment '商品类型的名称',

      index (type_name)

)engine myisam charset utf8;

 

商品的属性表:

create table it_attribute(

      id tinyint unsigned primary key auto_increment,

      type_id tinyint not null comment '商品类型的id',

      attr_name varchar(32) not null comment '属性的名称',

      attr_type tinyint  not null default 0 comment '属性的类型,0:表示唯一属性,1则表示是单选属性',

      attr_input_type  tinyint  not null default 0 comment '属性值的输入方式 0:表示手工输入,1则是列表选择',

      attr_value varchar(64) not null default '' comment '属性的默认值,列表选择使用',

      index (type_id)

)engine myisam charset utf8;

栏目管理

栏目表:

create table yd_category(

      id smallint unsigned primary key auto_increment,

      cat_name varchar(32) not null comment '栏目的名称',

      parent_id smallint unsigned not null default 0 comment '父级栏目的id'

)engine myisam charset utf8;

 

posted @ 2015-10-20 22:02  lesuso  阅读(661)  评论(0编辑  收藏  举报