創建一個庫:_shop
創建三個表(對應的圖有對應字段名):
菜單:menu

菜單分類:menu_type

訂單:order

建表語句:
create table menu(
menu_id int unsigned auto_increment,
menu_name varchar(100) not null,
menu_price decimal(10,2) default 0,
menu_stutas tinyint default 1 comment"defult 1, 1:在線 2:刪除3:售空 ",
type_id int unsigned,
img varchar(255),
ctime timestamp,
primary key (menu_id)
);
create table menu_type(
type_id int unsigned primary key auto_increment,
type_name varchar(50) not null
);
create table corder(
order_id int unsigned primary key auto_increment,
menu_id int unsigned ,
num smallint unsigned comment"defult 1, 1:1份",
totle_price decimal(14,2) not null,
ctime timestamp,
order_stutas tinyint default 1 comment"defult 1, 1:下單 2:取消 ",
pay_stutas tinyint default 1 comment"defult 1, 1:支付成功 2:支付失敗 ",
mark text
);
menu_id int unsigned auto_increment,
menu_name varchar(100) not null,
menu_price decimal(10,2) default 0,
menu_stutas tinyint default 1 comment"defult 1, 1:在線 2:刪除3:售空 ",
type_id int unsigned,
img varchar(255),
ctime timestamp,
primary key (menu_id)
);
create table menu_type(
type_id int unsigned primary key auto_increment,
type_name varchar(50) not null
);
create table corder(
order_id int unsigned primary key auto_increment,
menu_id int unsigned ,
num smallint unsigned comment"defult 1, 1:1份",
totle_price decimal(14,2) not null,
ctime timestamp,
order_stutas tinyint default 1 comment"defult 1, 1:下單 2:取消 ",
pay_stutas tinyint default 1 comment"defult 1, 1:支付成功 2:支付失敗 ",
mark text
);