酒店管理系统数据库表和SQL

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

酒店管理系统数据库表和SQL

010.tydis

扩展:

物价赔偿表

采购表

员工表

数据库的表分别为:管理员信息表(operator),房间类型表(roomType), 房间信息表(roomInfo),客户类型表(customerType),客户信息表(customer),入住信息表(liveIn),预订信息表(engage),结账表(account),酒店简介表(companyIntroduce),酒店新闻表(news),天气信息表(temp),特惠信息表(tehui)。

create table roomType(

PK integer primary key, roomTypeID char(1) check(roomTypeID

in('A','B','C','D','E','F','G','H')) unique

not null,

roomTypeName varchar2(15) not null, roomPrice float not null, roomBedNum int,

foregift float,

cl_room int,

cl_price float,

remark varchar2(40),

delmark int);

/

create table operator(

PK integer primary key,

userID varchar2(10) unique not null, pwd varchar2(10) not null,

puis int,

in_time date,

login_num int

);

/

create table customer(

PK integer primary key,

c_ID varchar2(20) unique not null, pwd varchar2(15) not null,

c_name varchar2(15) not null, c_sex char(2) check(c_sex in('男','女')) not null, zj_type varchar2(15) not null, zj_no varchar2(20) not null, c_addr varchar2(40),

c_tel varchar2(20) not null, remark varchar2(40),

delmark int,

c_type_id char(1),

jifen int,

foreign key(c_type_id) references customerType(customerID)

);

/

create table customerType(

PK integer primary key,

customerID char(1) check(customerID in('A','B','C','D','E','F','G')) unique not

null,

c_type_name varchar2(15) not null, dis_attr varchar2(15),

discount float,

remark varchar2(40),

delmark int

);

/

create table roomInfo(

PK integer primary key,

roomID char(3) not null unique,

roomTypeID char(1) not null, roomState char(1) check(RoomState

in('0','1')) not null,

roomTel varchar2(10) not null, roomLoc varchar2(10),

remark varchar2(40),

delmark int,

foreign key (roomTypeID) references roomType(roomTypeID)

);

/

create table liveIn(

PK integer primary key,

in_no varchar2(10) not null unique, roomID char(3) not null,

c_ID varchar2(10),

c_name varchar2(15) not null, c_sex char(2) check(c_sex in('男','女')) not null, zj_type varchar2(15) not null, zj_no varchar2(25) not null, addr varchar2(50),

renshu int,

in_time date,

leave_time date,

delmark int,--客户离开

c_tel varchar2(20),

foreign key (roomID) references roomInfo(roomID)

);

/

create table engage(

PK integer primary key,

c_ID varchar2(10) not null, roomID char(3) not null,

engage_time date,

in_time date,

leave_time date,

engage_mark int,

delmark int,

foreign key (roomID) references roomInfo(roomID),

foreign key (c_ID) references customer(c_ID)

);

/

create table account(

相关文档
最新文档