mysql 京东
DROP TABLE IF EXISTS `jd_admin`;
CREATE TABLE `jd_admin` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`username` varchar(30) NOT NULL COMMENT ‘用户名‘,
`password` varchar(64) NOT NULL COMMENT ‘密码‘,
`salt` char(6) NOT NULL COMMENT ‘加密KEY‘,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT ‘管理员表‘;
INSERT INTO `jd_admin` VALUES (1,‘admin‘,‘86f3059b228c8acf99e69734b6bb32cc‘,‘admin‘),(3,‘333‘,‘2222‘,‘‘),(4,‘555‘,‘0595fd2f9bae57aa90ff1112b459ecd4‘,‘4c2134‘);
CREATE table jd_type( id int unsigned not null AUTO_INCREMENT COMMENT ‘主键ID‘, type_name varchar(30) not null COMMENT ‘类型名称‘, primary key(id) )ENGINE=InnoDB default charset=utf8 COMMENT ‘商品类型表‘; insert into jd_type values(null,‘电脑‘); DROP TABLE IF EXISTS jd_attribute; CREATE table jd_attribute( id int unsigned not null AUTO_INCREMENT COMMENT ‘主键ID‘, attr_name varchar(30) not null COMMENT‘属性名称‘, attr_type int not null COMMENT ‘属性类型‘, attr_value varchar(300) not null DEFAULT ‘‘ COMMENT ‘属性可选值‘, type_id int unsigned not null COMMENT ‘类型ID‘, PRIMARY KEY(id), FOREIGN KEY (type_id) REFERENCES jd_type(id) on DELETE CASCADE, KEY type_id(type_id), KEY attr_type(attr_type) )ENGINE=InnoDB DEFAULT charset=utf8 COMMENT ‘商品属性表‘;
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。