某宾馆客房管理系统.docx
- 文档编号:15434783
- 上传时间:2023-07-04
- 格式:DOCX
- 页数:22
- 大小:226.56KB
某宾馆客房管理系统.docx
《某宾馆客房管理系统.docx》由会员分享,可在线阅读,更多相关《某宾馆客房管理系统.docx(22页珍藏版)》请在冰点文库上搜索。
某宾馆客房管理系统
《数据库系统》课程实践任务报告
任务名称:
某宾馆客房管理系统
班级:
学号:
姓名:
学号:
姓名:
完成日期:
2015年06月30日
信息工程学院计算机系
任务名称:
某宾馆客房管理系统
1.任务的描述
随着宾馆业竞争的加剧,传统的宾馆计算机管理系统已无法满足宾馆信息化管理的需要。
为了拓展经营空间、降低成本和提高管理效率,宾馆需要使用更高效的信息化手段,借助先进的计算机信息技术对宾馆进行管理。
因此为了对某宾馆实现客房情况的信息化管理,特设计并实现一个涉及到SQLServer数据库的重要数据库对象、功能和特性的某宾馆客房管理系统,新的宾馆客房管理系统科学的将宾馆各种业务完美的结合,方便管理和决策,并且能提供大量的管理经营过程中实际的数据。
宾馆客房管理系统要求实现以下功能:
1、实现客房类型、价目信息、客房信息的管理;
2、实现客户信息的管理;
3、实现入住和退房管理;
4、实现费用管理;
5、创建触发器,实现入住和退房时自动修改客房的状态;
6、创建存储过程统计某段时间内各种类型的客房的入住时间合计和费用合计;
7、创建视图查询某一时刻没有入住的房间信息;
8、建立数据库相关表之间的参照完整性约束。
2.需求分析
本系统主要包括的外部实体有:
客户、客房信息、客户住宿、前台、客房状态,要实现的功能主要有:
客户、客房等信息的管理。
2.1系统包含的实体
根据“任务描述”中提供的信息以及系统需要实现的功能,本系统应包含的实体及其包含的属性名如下:
客户(身份证号码,姓名,性别,出生日期,地址)
前台(编号,姓名)
客房信息(客房号,客房类型,客房数量,价格,客房状态)
客户住宿(客房号,客房类型,入住时间,消费费用,住宿时间,退房时间)
费用(客房类型,房费,消费费用,押金)
入住信息(入住编号,入住时间,入住人数)
退房信息(退房编号,退房时间)
客房类型(类型编号,类型名称,价格)
楼层信息(楼层编号,楼层名)
2.2系统包含的实体间联系
根据“任务描述”中提供的信息以及宾馆的实际情况,本系统中实体之间应有如下的联系:
存在联系:
实体“客户”与“客房”之间的联系,包含属性:
客房号。
联系类型:
一对多。
入住联系:
实体“客户”与“入住信息”之间的联系,不包含属性。
联系类型:
一对多。
住宿联系:
实体“客房”与“客户住宿”之间的联系,包含属性:
客房号,客房类型。
联系类型:
一对多。
包含联系:
实体“客房”与“客房类型”之间的联系,不包含属性。
联系类型:
一对多。
属于联系:
实体“客房”与“楼层信息”之间的联系,不包含属性。
联系类型:
多对多。
管理联系:
实体“客户”与“前台”之间的联系,不包含属性。
联系类型:
一对多。
2.3系统需实现的功能
根据“任务描述”中提供的信息以及宾馆的实际情况,本系统需具有如下的功能:
1、对本系统中具有的实体及实体间联系的信息存储;
2、具体有如下的静态查询:
1)对客房信息(客房号、收费标准、类型、入住情况)的查询:
2)对客户信息(身份证号、居住地址、姓名、性别、出生日期等)的查询;
3)对客户住宿信息(客房号,客房类型,入住时间,住宿费用,住宿时间,退房时间)的查询;
4)对客房状态(入住、退房)的查询;
3、具体有如下的动态查询:
1)给定身份证号码,查询该客户的身份信息、客户住宿信息;
2)给定客房号,查询该客房的信息、客房状态;
2.4数据流图
根据“需要分析”中对本系统包含的实体及需要实现的功能的描述,设计并绘制出本系统的数据流图如下:
(1)第一层数据流图
(2)第二层数据流图
2.5数据字典
根据数据流图中的实体、数据存储,本系统需要如下数据字典:
(1)数据字典名:
客户
表示的对象:
客户实体
数据结构:
客户=姓名(字符串类型)+性别(字符串类型)+地址(字符串类型)+出生日期(日期类型)+身份证号(字符串类型)+电话(字符串类型)
(2)数据字典名:
前台
表示的对象:
前台实体
数据结构:
前台=姓名(字符串类型)+性别(字符串类型)
(3)数据字典名:
客房
表示的对象:
客房实体
数据结构:
客房=客房号(整型)+客房类型(字符串类型)+客房数量(整型)+价格(整型)+客房状态(字符串类型)
(4)数据字典名:
客户住宿
表示的对象:
客户住宿实体
数据结构:
客户住宿=客房号(整型)+客房类型(字符串类型)+住宿时间(字符串类型)+消费费用(整型)+入住时间(字符串类型)+退房时间(字符串类型)
(5)数据字典名:
客房类型
表示的对象:
客房类型实体
数据结构:
客房类型=类型编号(字符串类型)+类型名称(整型)
(6)数据字典名:
账单信息
表示的对象:
账单信息实体
数据结构:
账单信息=客房类型(字符串类型)+消费费用(整型)+房费(整型)+押金(整型)
(7)数据字典名:
入住信息
表示的对象:
入住信息实体
数据结构:
入住信息=入住编号(定长字符串类型)+入住人数(整型)+入住时间(字符串类型)
(8)数据字典名:
退房信息
表示的对象:
退房信息实体
数据结构:
退房信息=退房编号(定长字符串类型)+退房时间(字符串类型)
(9)数据字典名:
楼层信息
表示的对象:
楼层信息实体
数据结构:
楼层信息=楼层编号(定长字符串类型)+楼层名(字符串类型)
3.数据库概念数据模型设计
根据“需求分析”中对本系统包含的实体及实体间联系的描述,本系统的数据库概念数据模型图如下:
4.数据库逻辑数据模型设计
此处根据数据库概念数据模型和数据库概念模型向关系数据库模型转换的规则,生成出系统的数据库逻辑数据模型。
5.数据库物理数据模型设计
此处根据数据库概念数据模型生成数据库物理数据模型后,截图粘贴到此处。
6.建立数据库的SQL代码
ifexists(select1fromsys.sysforeignkeywhererole='FK_ENTITY_6_RELATIONS_客户')then
altertableEntity_6
deleteforeignkeyFK_ENTITY_6_RELATIONS_客户
endif;
ifexists(select1fromsys.sysforeignkeywhererole='FK_客户_RELATIONS_客房')then
altertable客户
deleteforeignkeyFK_客户_RELATIONS_客房
endif;
ifexists(select1fromsys.sysforeignkeywhererole='FK_客户_RELATIONS_ENTITY_8')then
altertable客户
deleteforeignkeyFK_客户_RELATIONS_ENTITY_8
endif;
ifexists(select1fromsys.sysforeignkeywhererole='FK_客户_RELATIONS_ENTITY_9')then
altertable客户
deleteforeignkeyFK_客户_RELATIONS_ENTITY_9
endif;
ifexists(select1fromsys.sysforeignkeywhererole='FK_客户住宿_RELATIONS_客房')then
altertable客户住宿
deleteforeignkeyFK_客户住宿_RELATIONS_客房
endif;
ifexists(select1fromsys.sysforeignkeywhererole='FK_客房_RELATIONS_前台')then
altertable客房
deleteforeignkeyFK_客房_RELATIONS_前台
endif;
ifexists(select1fromsys.sysforeignkeywhererole='FK_客房_RELATIONS_ENTITY_7')then
altertable客房
deleteforeignkeyFK_客房_RELATIONS_ENTITY_7
endif;
ifexists(select1fromsys.sysforeignkeywhererole='FK_客房_RELATIONS_ENTITY_1')then
altertable客房
deleteforeignkeyFK_客房_RELATIONS_ENTITY_1
endif;
dropindexifexistsEntity_10.Entity_10_PK;
droptableifexistsEntity_10;
dropindexifexistsEntity_6.Relationship_7_FK;
dropindexifexistsEntity_6.Entity_6_PK;
droptableifexistsEntity_6;
dropindexifexistsEntity_7.Entity_7_PK;
droptableifexistsEntity_7;
dropindexifexistsEntity_8.Entity_8_PK;
droptableifexistsEntity_8;
dropindexifexistsEntity_9.Entity_9_PK;
droptableifexistsEntity_9;
dropindexifexists前台.前台_PK;
droptableifexists前台;
dropindexifexists客户.Relationship_5_FK;
dropindexifexists客户.Relationship_4_FK;
dropindexifexists客户.Relationship_3_FK;
dropindexifexists客户.客户_PK;
droptableifexists客户;
dropindexifexists客户住宿.Relationship_6_FK;
dropindexifexists客户住宿.客户住宿_PK;
droptableifexists客户住宿;
dropindexifexists客房.Relationship_8_FK;
dropindexifexists客房.Relationship_2_FK;
dropindexifexists客房.Relationship_1_FK;
dropindexifexists客房.客房_PK;
droptableifexists客房;
/*==============================================================*/
/*Table:
Entity_10*/
/*==============================================================*/
createtableEntity_10
(
Attribute_34char(10)notnull,
Attribute_35char(10)null,
constraintPK_ENTITY_10primarykey(Attribute_34)
);
/*==============================================================*/
/*Index:
Entity_10_PK*/
/*==============================================================*/
createuniqueindexEntity_10_PKonEntity_10(
Attribute_34ASC
);
/*==============================================================*/
/*Table:
Entity_6*/
/*==============================================================*/
createtableEntity_6
(
Attribute_21char(10)notnull,
身份证号char(18)null,
Attribute_22char(10)null,
Attribute_23char(10)null,
Attribute_24char(10)null,
constraintPK_ENTITY_6primarykey(Attribute_21)
);
/*==============================================================*/
/*Index:
Entity_6_PK*/
/*==============================================================*/
createuniqueindexEntity_6_PKonEntity_6(
Attribute_21ASC
);
/*==============================================================*/
/*Index:
Relationship_7_FK*/
/*==============================================================*/
createindexRelationship_7_FKonEntity_6(
身份证号ASC
);
/*==============================================================*/
/*Table:
Entity_7*/
/*==============================================================*/
createtableEntity_7
(
Attribute_26char(10)notnull,
Attribute_27char(10)null,
Attribute_28char(10)null,
constraintPK_ENTITY_7primarykey(Attribute_26)
);
/*==============================================================*/
/*Index:
Entity_7_PK*/
/*==============================================================*/
createuniqueindexEntity_7_PKonEntity_7(
Attribute_26ASC
);
/*==============================================================*/
/*Table:
Entity_8*/
/*==============================================================*/
createtableEntity_8
(
Attribute_29char(10)notnull,
Attribute_30char(10)null,
Attribute_31char(10)null,
constraintPK_ENTITY_8primarykey(Attribute_29)
);
/*==============================================================*/
/*Index:
Entity_8_PK*/
/*==============================================================*/
createuniqueindexEntity_8_PKonEntity_8(
Attribute_29ASC
);
/*==============================================================*/
/*Table:
Entity_9*/
/*==============================================================*/
createtableEntity_9
(
Attribute_32char(10)notnull,
Attribute_33char(10)null,
constraintPK_ENTITY_9primarykey(Attribute_32)
);
/*==============================================================*/
/*Index:
Entity_9_PK*/
/*==============================================================*/
createuniqueindexEntity_9_PKonEntity_9(
Attribute_32ASC
);
/*==============================================================*/
/*Table:
前台*/
/*==============================================================*/
createtable前台
(
编号char(10)notnull,
姓名varchar(20)null,
constraintPK_前台primarykey(编号)
);
/*==============================================================*/
/*Index:
前台_PK*/
/*==============================================================*/
createuniqueindex前台_PKon前台(
编号ASC
);
/*==============================================================*/
/*Table:
客户*/
/*==============================================================*/
createtable客户
(
身份证号char(18)notnull,
Attribute_32char(10)null,
客房号char(10)null,
Attribute_29char(10)null,
姓名varchar(20)null,
性别char
(2)null,
地址longvarcharnull,
出生日期timestampnull,
电话char(11)null,
constraintPK_客户primarykey(身份证号)
);
/*==============================================================*/
/*Index:
客户_PK*/
/*==============================================================*/
createuniqueindex客户_PKon客户(
身份证号ASC
);
/*==============================================================*/
/*Index:
Relationship_3_FK*/
/*==============================================================*/
createindexRelationship_3_FKon客户(
客房号ASC
);
/*==============================================================*/
/*Index:
Relationship_4_FK*/
/*==============================================================*/
createindexRelationship_4_FKon客户(
Attribute_29ASC
);
/*==============================================================*/
/*Index:
Relationship_5_FK*/
/*==============================================================*/
createindexRelationship_5_FKon客户(
Attribute_32ASC
);
/*==============================================================*/
/*Table:
客户住宿*/
/*==============================================================*/
createtable客户住宿
(
Attribute_17char(10)notnull,
Attribute_18char(10)notnull,
客房号char(10)null,
入住时间char(10)null,
住宿时间char(10)null,
退房时间char(10)null,
消费费用char(10)null,
constraintPK_客户住宿primarykey(Attribute_17,Att
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 宾馆 客房 管理 系统