数据库上机(2)
发布时间:2021-06-11
发布时间: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;
上一篇:数列极限(习题总结)