团队第五篇

这一周,我们主要运用本学期所学的数据库知识来完成。用所学的SQL语句来对上周所建立的数据表进行创建。下面是小组成员创建的语句及截图:

用户(用户名,电话,会员等级,积分)

create table Users

( U# char(6) not null,

Name char(8) not null,

Phone char(20),

Level char(10),

Score int,

Primary key(U#)

);

 

菜单(菜品名,单价):

create table MENU

( 

Cname varchar(50) not null,  

unitprice int not null,  

) 

用户菜单(桌号,菜名,数量)

create table UserMenu  
(  
D# int primary key,   
Cname varchar(50) not null,   
number int not null,   
)  

 

订单(订单号,口味,备注,付款状态,上菜状态,用户,桌号)

create table Orders 
( T# char(8) not null,

U# char(6) not null, 

D# int not null ,

Taste char(6), 

Remark char(20),

Ispay varchar(4), 

Serving varchar(4),Primary key(T#, U#, D#),

Primary key(T#) references punish(T#),

Primary key(U#) references punish(U#),

Primary key(D#) references punish(D#),

);

 

这就是4张标的具体创建语句。我们将会添加一些实验数据,下周继续完成这个餐厅点单系统的制作。

posted @ 2017-05-21 15:22  柯艾  阅读(84)  评论(0编辑  收藏  举报