create table employ(
ecardid char(20),
eid char(20) not null,
ename char(20) not null,
esex char(20) not null,
etelenum char(20),
position char(20),
primary key (eid),
check (esex in ('男','女')),
check(position in('员工'))
)
create table manage(
mcardid char(20),
mid char(20) not null,
mname char(20) not null,
msex char(20) not null,
mtelenum char(20),
position char(20),
primary key (mid),
check (msex in ('男','女')),
check(position in('经理'))
)
create table menu(
dishno char(20),
danjia float(20) not null unique,
dishname char(20) not null unique,
pingzong char(20),
worktime char(20),
shiduan char(20) not null unique,
primary key(dishno),
check(pingzong in('主菜','特价菜','酒水','主食')),
check (shiduan in('早','中','晚'))
)
create table work(
mid char(20),
eid char(20),
worktime char(20),
shiduan char(20) ,
riqi char(20),
primary key(mid),
check (worktime in('星期一','星期二','星期三','星期四','星期五')),
check (shiduan in('早','中','晚')),
foreign key (mid) references manage(mid),
foreign key (eid) references employ(eid),
foreign key (shiduan) references menu(shiduan)
)
create table discount (
num char(20),
discount char(20),
dishname char(20) not null,
pingzong char(20),
primary key(num),
check (pingzong in('主菜')),
foreign key (dishname) references menu(dishname)
)
create table xiadan(
eid char(20),
shiduan char(20) not null,
dishname char(20) not null,
qty smallint,
danjia float(20) not null,
num char(20) not null,
primary key(eid),
foreign key (eid) references employ(eid),
foreign key (shiduan) references menu(shiduan),
foreign key (dishname) references menu(dishname),
foreign key (num) references discount(num)
)
create database restaurant
create table manage(
mcardid char(20),
mno char(20) not null unique ,
mname char(20) not null,
msex char(20) not null,
mtelenum char(20),
position char(20),
primary key (mno),
check (msex in ('男','女')),
check(position in('经理'))
)
create table employ(
ecardid char(20),
eno char(20) not null,
ename char(20) not null,
esex char(20) not null,
etelenum char(20),
position char(20),
primary key (eno),
check (esex in ('男','女')),
check(position in('员工'))
)
create table breakfast(
bname char(20),
bno char(20),
bprice float(3),
primary key (bno)
)
drop table lunch;
create table lunch(
lname char(20) not null unique,
lno char(20),
ltype char(20) not null unique,
lprice float(3) not null unique,
primary key (lno),
check (ltype in('zucai','zushi','jiushui','tenjiacai'))
)
create table super(
sname char(20),
sno char(20),
sprice float(3),
primary key (sno)
)
create table worktime(
mno char(20) not null,
eno char(20),
dailytime char(20),
fhours smallint,
shours smallint,
dates char(20),
primary ke
y(dates,mno),
check (dailytime in('morning','noon','night')),
check ((fhours-shours)=5 and (shours=6 or shours=11 or shours=16) and (fhours=11
数据库上机
时间:2022-11-24 10:09:22
作者:壹号
字数:2822字
最新推荐
- 12013-2017年中国杀虫剂市场全景调研及发展趋势研究报告
- 2数据库上机
- 3s7-300和组态王在煤矿自动系统中的应用设计
- 4自考电子商务法概论第3章电子合同
- 5巴黎圣母院中的美丑对照原则
- 6IGBT驱动器输出性能的计算
- 7《财政学》第三章财政支出概述
- 8太阳能光伏发电技术的应用现状与发展趋势
- 9基于web的物流公司管理系统的设计与实现论文
- 10能源与环境系统工程概论复习导向
- 11原位制备技术的现状及发展
- 12数码照片冲印尺寸对应表
- 13广外--英语(国际商务管理)介绍
- 14中国残联领导听取甘肃省残联工作汇报
- 152013五年级语文上册 前三单元调研试卷(无答案) 苏教版
- 162012年中国地质大学远程教育招生简章
- 17民办幼儿园办园申请书
- 18电机淘汰名录
- 19论历史唯物主义的当代意蕴
- 20三年级数学进度表
标签云
猜你喜欢
- EN10025-5-2005
- “十三五”重点项目-干洗机生产建设项目可行性研究报告
- 皮带机智能监控保护系统设计
- 中国邮政储蓄银行的相关工作报告情况
- 中国企业反倾销的现状及应对措施
- 调查问卷分析报告
- 初三语文寒假作业
- 偏光片基础理论
- PMP5201G中文资料
- 维修电工个人工作总结
- 饱和铵贮库施肥法对芹菜氮素吸收、产量和品质的影响
- 心血管外科护理论文全科医学论文
- 06-07学年度第二学期研究生课程表-公共课
- 中国矿业大学银川学院计算机中心的建设与管理
- β 受体阻滞剂 在高血压中 的临床应用
- 凸轮机构设计(图文)
- 小学六年级上册数学教学反思
- 第八讲 水的浮力(二)
- 幼儿园中班健康动作教案《遥控机器人》
- 省钱小户型家居装修