データベース設計ログイン

データベース設計

1,新建データベース库onecms

CREATE DATABASE onecms;

2,新建goods表:

CREATE TABLE Goods(

id ​​int(11) not null 主キー auto_increment,

goodstypeid int(11) NOT NULL、

goodstypefid int(11) NOT NULL、

goodstypefstr varchar(33) NOT NULL、

title varchar(255) NOT NULL、

flag varchar(33) NOT NULL、

marketprice int(11) NOT NULL、

salesprice int(11) NOT NULL、

housenum int(11) NOT NULL、

content VARCHAR(255) NOT NULL、

picurl varchar(255) NOT NULL、

hits int(11),

orderid int(11),

checkinfo smallint(1),

delstate smallint(1))ENGINE=InnoDB DEFAULT CHARSET=utf8;

微信图片_20180308142211.png

3,新建goodstype表

#CREATE TABLE Goodstype(

id ​​int(11) not null 主キー auto_increment,

fid int(11) NOT NULL、

classname varchar(255) NOT NULL、

orderid int(11) NOT NULL ,

checkinfo int(11) NOT NULL,

fstr VARCHAR(33) NOT NULL)

ENGINE=InnoDB DEFAULT CHARSET=utf8;

微信图片_20180308142558.png

4,插入赋试データ

##商品表插入量:##

INSERT INTO `goods` VALUES ('1', '2', '0', '0,2,', 'Huawei 携帯電話', '', '1000', '800', ' 1 ', 'Huawei P10Plus', './uploads/c2922d7d93043572a95bd8b5289a41b.png', '18', '1', '1', '0');

INSERT INTO ` Goods ` VALUES ('2', '4', '3', '0,3,4,', 'ダウンジャケット', '', '1000', '888', '0', 'ピュアダックダウンジャケット', ' ./uploads/1397f1630770e4cc2d407c1911c2ecc.png', '3', '2', '1', '0');

「商品」の値に挿入 ('3 ', ' 1', '0', '0,1,', 'ノートブック', '', '3800', '3666', '0', 'Lenovo thinkpad ノートブック', './uploads/fd9ecdaf3ee9a9035f51da6471e3f90.png ', ' 2', '3', '1', '0');

データを商品タイプ テーブルに挿入します:

INSERT INTO `goodstype` VALUES ('1', '0', 'Computer', '1', '1', '0,');

#INSERT INTO `goodstype ` VALUES ('2', '0', 'mobilephone', '2', '1', '0,');

INSERT INTO ` Goodstype` VALUES ('3 ', '0', 'clothes', '3', '0', '0,');

INSERT INTO `goodstype` VALUES (' 4', '3' , 'ダウンジャケット', '4', '1', '0,3,');


次のセクション

<?php echo "数据库设计";
コースウェア