手机版

数据库上机(2)

发布时间:2021-06-11   来源:未知    
字号:

or fhours=16 or fhours=21)),
foreign key (mno) references manage(mno),
foreign key (eno) references employ(eno)
)
drop table worktime;
alter table worktime
alter column dates char(20);

create table discountcard(
dno char(20),
levels float(3),
ltype char(20),
primary key (dno),
foreign key (ltype) references lunch(ltype),
check (ltype in('zucai'))
)
drop table discountcard;
drop table bill;

create table bill(
eno char(20),
billtime char(20),
lname char(20),
lprice float(3),
qty float(3),
dno char(20),
primary key(eno,billtime),
foreign key (lname) references lunch(lname),
foreign key (lprice) references lunch(lprice),
foreign key (dno) references discountcard(dno)
)
insert
into employ(ecardid,eno,ename ,esex ,etelenum ,position)
values('03090001','01','张玉梅','女','091273','员工');
insert
into employ(ecardid,eno,ename ,esex ,etelenum ,position)
values('03090002','02','王海霞','女','091243','员工');
insert
into employ(ecardid,eno,ename ,esex ,etelenum ,position)
values('03090003','03','李海燕','女','091223','员工');
insert
into employ(ecardid,eno,ename ,esex ,etelenum ,position)
values('03090004','04','李东学','男','091254','员工');
insert
into manage(mcardid,mno,mname ,msex ,mtelenum ,position)
values('03090010','10','海萍','女','091224','经理');
insert
into manage(mcardid,mno,mname ,msex ,mtelenum ,position)
values('03090020','20','李涛','女','091244','经理');
insert
into lunch(lname ,lno ,ltype ,lprice )
values('土豆烧牛肉','1','zucai','25.0');
insert
into lunch
values('土豆丝','2','tenjiacai','10.0');
insert
into worktime(mno ,eno ,dailytime ,fhours ,shours ,dates )
values('10','01','noon',16,11,'20120123');
insert
into discountcard(dno,levels,ltype)
values('
001',0.01,'zucai');
insert
into bill(eno,billtime,lname,lprice,qty,dno)
values('01','20120123','土豆烧牛肉',25.0,1,'001');
select *
from bill;

数据库上机(2).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
×
二维码
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)