




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、數(shù)據(jù)庫系統(tǒng)課程實(shí)踐任務(wù)報(bào)告任務(wù)名稱: 某賓館客房管理系統(tǒng) 班 級: 學(xué) 號: 姓 名: 學(xué) 號: 姓 名: 完成日期: 2015年06月30日 信息工程學(xué)院 計(jì)算機(jī)系任務(wù)名稱:某賓館客房管理系統(tǒng)1任務(wù)的描述隨著賓館業(yè)競爭的加劇,傳統(tǒng)的賓館計(jì)算機(jī)管理系統(tǒng)已無法滿足賓館信息化管理的需要。為了拓展經(jīng)營空間、降低成本和提高管理效率,賓館需要使用更高效的信息化手段,借助先進(jìn)的計(jì)算機(jī)信息技術(shù)對賓館進(jìn)行管理。因此為了對某賓館實(shí)現(xiàn)客房情況的信息化管理,特設(shè)計(jì)并實(shí)現(xiàn)一個(gè)涉及到SQL Server數(shù)據(jù)庫的重要數(shù)據(jù)庫對象、功能和特性的某賓館客房管理系統(tǒng),新的賓館客房管理系統(tǒng)科學(xué)的將賓館各種業(yè)務(wù)完美的結(jié)合,方便管理和
2、決策,并且能提供大量的管理經(jīng)營過程中實(shí)際的數(shù)據(jù)。賓館客房管理系統(tǒng)要求實(shí)現(xiàn)以下功能:1、實(shí)現(xiàn)客房類型、價(jià)目信息、客房信息的管理;2、實(shí)現(xiàn)客戶信息的管理;3、實(shí)現(xiàn)入住和退房管理;4、實(shí)現(xiàn)費(fèi)用管理;5、創(chuàng)建觸發(fā)器,實(shí)現(xiàn)入住和退房時(shí)自動(dòng)修改客房的狀態(tài);6、創(chuàng)建存儲(chǔ)過程統(tǒng)計(jì)某段時(shí)間內(nèi)各種類型的客房的入住時(shí)間合計(jì)和費(fèi)用合計(jì);7、創(chuàng)建視圖查詢某一時(shí)刻沒有入住的房間信息;8、建立數(shù)據(jù)庫相關(guān)表之間的參照完整性約束。2需求分析本系統(tǒng)主要包括的外部實(shí)體有:客戶、客房信息、客戶住宿、前臺、客房狀態(tài),要實(shí)現(xiàn)的功能主要有:客戶、客房等信息的管理。2.1 系統(tǒng)包含的實(shí)體根據(jù)“任務(wù)描述”中提供的信息以及系統(tǒng)需要實(shí)現(xiàn)的功能,本
3、系統(tǒng)應(yīng)包含的實(shí)體及其包含的屬性名如下:客戶(身份證號碼,姓名,性別,出生日期,地址)前臺(編號,姓名)客房信息(客房號,客房類型,客房數(shù)量,價(jià)格,客房狀態(tài))客戶住宿(客房號,客房類型,入住時(shí)間,消費(fèi)費(fèi)用,住宿時(shí)間,退房時(shí)間)費(fèi)用(客房類型,房費(fèi),消費(fèi)費(fèi)用,押金)入住信息(入住編號,入住時(shí)間,入住人數(shù))退房信息(退房編號,退房時(shí)間)客房類型(類型編號,類型名稱,價(jià)格)樓層信息(樓層編號,樓層名)2.2 系統(tǒng)包含的實(shí)體間聯(lián)系根據(jù)“任務(wù)描述”中提供的信息以及賓館的實(shí)際情況,本系統(tǒng)中實(shí)體之間應(yīng)有如下的聯(lián)系:存在聯(lián)系:實(shí)體“客戶”與“客房”之間的聯(lián)系,包含屬性:客房號。聯(lián)系類型:一對多。入住聯(lián)系:實(shí)體“
4、客戶”與“入住信息”之間的聯(lián)系,不包含屬性。聯(lián)系類型:一對多。住宿聯(lián)系:實(shí)體“客房”與“客戶住宿”之間的聯(lián)系,包含屬性:客房號,客房類型。聯(lián)系類型:一對多。包含聯(lián)系:實(shí)體“客房”與“客房類型”之間的聯(lián)系,不包含屬性。聯(lián)系類型:一對多。屬于聯(lián)系:實(shí)體“客房”與“樓層信息”之間的聯(lián)系,不包含屬性。聯(lián)系類型:多對多。管理聯(lián)系:實(shí)體“客戶”與“前臺”之間的聯(lián)系,不包含屬性。聯(lián)系類型:一對多。2.3 系統(tǒng)需實(shí)現(xiàn)的功能 根據(jù)“任務(wù)描述”中提供的信息以及賓館的實(shí)際情況,本系統(tǒng)需具有如下的功能:1、對本系統(tǒng)中具有的實(shí)體及實(shí)體間聯(lián)系的信息存儲(chǔ);2、具體有如下的靜態(tài)查詢:1)對客房信息(客房號、收費(fèi)標(biāo)準(zhǔn)、類型、入
5、住情況)的查詢:2)對客戶信息(身份證號、居住地址、姓名、性別、出生日期等)的查詢;3)對客戶住宿信息(客房號,客房類型,入住時(shí)間,住宿費(fèi)用,住宿時(shí)間,退房時(shí)間)的查詢;4)對客房狀態(tài)(入住、退房)的查詢;3、具體有如下的動(dòng)態(tài)查詢:1)給定身份證號碼,查詢該客戶的身份信息、客戶住宿信息;2)給定客房號,查詢該客房的信息、客房狀態(tài);2.4 數(shù)據(jù)流圖根據(jù)“需要分析”中對本系統(tǒng)包含的實(shí)體及需要實(shí)現(xiàn)的功能的描述,設(shè)計(jì)并繪制出本系統(tǒng)的數(shù)據(jù)流圖如下:(1)第一層數(shù)據(jù)流圖(2)第二層數(shù)據(jù)流圖2.5 數(shù)據(jù)字典根據(jù)數(shù)據(jù)流圖中的實(shí)體、數(shù)據(jù)存儲(chǔ),本系統(tǒng)需要如下數(shù)據(jù)字典:(1)數(shù)據(jù)字典名:客戶表示的對象:客戶實(shí)體數(shù)據(jù)
6、結(jié)構(gòu):客戶=姓名(字符串類型)+性別(字符串類型)+地址(字符串類型)+出生日期(日期類型)+身份證號(字符串類型)+電話(字符串類型)(2)數(shù)據(jù)字典名:前臺表示的對象:前臺實(shí)體數(shù)據(jù)結(jié)構(gòu):前臺=姓名(字符串類型)+性別(字符串類型)(3)數(shù)據(jù)字典名:客房表示的對象:客房實(shí)體數(shù)據(jù)結(jié)構(gòu):客房=客房號(整型)+客房類型(字符串類型)+客房數(shù)量(整型)+價(jià)格(整型)+客房狀態(tài)(字符串類型)(4)數(shù)據(jù)字典名:客戶住宿表示的對象:客戶住宿實(shí)體數(shù)據(jù)結(jié)構(gòu):客戶住宿=客房號(整型)+客房類型(字符串類型)+住宿時(shí)間(字符串類型)+消費(fèi)費(fèi)用(整型)+入住時(shí)間(字符串類型)+退房時(shí)間(字符串類型)(5)數(shù)據(jù)字典名:
7、客房類型 表示的對象:客房類型實(shí)體數(shù)據(jù)結(jié)構(gòu):客房類型=類型編號(字符串類型)+類型名稱(整型)(6)數(shù)據(jù)字典名:賬單信息表示的對象:賬單信息實(shí)體數(shù)據(jù)結(jié)構(gòu):賬單信息=客房類型(字符串類型)+消費(fèi)費(fèi)用(整型)+房費(fèi)(整型)+押金(整型)(7)數(shù)據(jù)字典名:入住信息表示的對象:入住信息實(shí)體數(shù)據(jù)結(jié)構(gòu):入住信息=入住編號(定長字符串類型)+入住人數(shù)(整型)+ 入住時(shí)間(字符串類型)(8)數(shù)據(jù)字典名:退房信息表示的對象:退房信息實(shí)體數(shù)據(jù)結(jié)構(gòu):退房信息=退房編號(定長字符串類型)+ 退房時(shí)間(字符串類型)(9)數(shù)據(jù)字典名:樓層信息表示的對象:樓層信息實(shí)體數(shù)據(jù)結(jié)構(gòu):樓層信息=樓層編號(定長字符串類型)+ 樓層名
8、(字符串類型)3. 數(shù)據(jù)庫概念數(shù)據(jù)模型設(shè)計(jì)根據(jù)“需求分析”中對本系統(tǒng)包含的實(shí)體及實(shí)體間聯(lián)系的描述,本系統(tǒng)的數(shù)據(jù)庫概念數(shù)據(jù)模型圖如下:4數(shù)據(jù)庫邏輯數(shù)據(jù)模型設(shè)計(jì)此處根據(jù)數(shù)據(jù)庫概念數(shù)據(jù)模型和數(shù)據(jù)庫概念模型向關(guān)系數(shù)據(jù)庫模型轉(zhuǎn)換的規(guī)則,生成出系統(tǒng)的數(shù)據(jù)庫邏輯數(shù)據(jù)模型。5. 數(shù)據(jù)庫物理數(shù)據(jù)模型設(shè)計(jì)此處根據(jù)數(shù)據(jù)庫概念數(shù)據(jù)模型生成數(shù)據(jù)庫物理數(shù)據(jù)模型后,截圖粘貼到此處。6建立數(shù)據(jù)庫的SQL代碼if exists(select 1 from sys.sysforeignkey where role='FK_ENTITY_6_RELATIONS_客戶') then alter table Entit
9、y_6 delete foreign key FK_ENTITY_6_RELATIONS_客戶end if;if exists(select 1 from sys.sysforeignkey where role='FK_客戶_RELATIONS_客房') then alter table 客戶 delete foreign key FK_客戶_RELATIONS_客房end if;if exists(select 1 from sys.sysforeignkey where role='FK_客戶_RELATIONS_ENTITY_8') then alter
10、 table 客戶 delete foreign key FK_客戶_RELATIONS_ENTITY_8end if;if exists(select 1 from sys.sysforeignkey where role='FK_客戶_RELATIONS_ENTITY_9') then alter table 客戶 delete foreign key FK_客戶_RELATIONS_ENTITY_9end if;if exists(select 1 from sys.sysforeignkey where role='FK_客戶住宿_RELATIONS_客房
11、9;) then alter table 客戶住宿 delete foreign key FK_客戶住宿_RELATIONS_客房end if;if exists(select 1 from sys.sysforeignkey where role='FK_客房_RELATIONS_前臺') then alter table 客房 delete foreign key FK_客房_RELATIONS_前臺end if;if exists(select 1 from sys.sysforeignkey where role='FK_客房_RELATIONS_ENTITY_
12、7') then alter table 客房 delete foreign key FK_客房_RELATIONS_ENTITY_7end if;if exists(select 1 from sys.sysforeignkey where role='FK_客房_RELATIONS_ENTITY_1') then alter table 客房 delete foreign key FK_客房_RELATIONS_ENTITY_1end if;drop index if exists Entity_10.Entity_10_PK;drop table if exist
13、s Entity_10;drop index if exists Entity_6.Relationship_7_FK;drop index if exists Entity_6.Entity_6_PK;drop table if exists Entity_6;drop index if exists Entity_7.Entity_7_PK;drop table if exists Entity_7;drop index if exists Entity_8.Entity_8_PK;drop table if exists Entity_8;drop index if exists Ent
14、ity_9.Entity_9_PK;drop table if exists Entity_9;drop index if exists 前臺.前臺_PK;drop table if exists 前臺;drop index if exists 客戶.Relationship_5_FK;drop index if exists 客戶.Relationship_4_FK;drop index if exists 客戶.Relationship_3_FK;drop index if exists 客戶.客戶_PK;drop table if exists 客戶;drop index if exis
15、ts 客戶住宿.Relationship_6_FK;drop index if exists 客戶住宿.客戶住宿_PK;drop table if exists 客戶住宿;drop index if exists 客房.Relationship_8_FK;drop index if exists 客房.Relationship_2_FK;drop index if exists 客房.Relationship_1_FK;drop index if exists 客房.客房_PK;drop table if exists 客房;/*=*/* Table: Entity_10 */*=*/crea
16、te table Entity_10 ( Attribute_34 char(10) not null, Attribute_35 char(10) null, constraint PK_ENTITY_10 primary key (Attribute_34);/*=*/* Index: Entity_10_PK */*=*/create unique index Entity_10_PK on Entity_10 (Attribute_34 ASC);/*=*/* Table: Entity_6 */*=*/create table Entity_6 ( Attribute_21 char
17、(10) not null, 身份證號 char(18) null, Attribute_22 char(10) null, Attribute_23 char(10) null, Attribute_24 char(10) null, constraint PK_ENTITY_6 primary key (Attribute_21);/*=*/* Index: Entity_6_PK */*=*/create unique index Entity_6_PK on Entity_6 (Attribute_21 ASC);/*=*/* Index: Relationship_7_FK */*=
18、*/create index Relationship_7_FK on Entity_6 (身份證號 ASC);/*=*/* Table: Entity_7 */*=*/create table Entity_7 ( Attribute_26 char(10) not null, Attribute_27 char(10) null, Attribute_28 char(10) null, constraint PK_ENTITY_7 primary key (Attribute_26);/*=*/* Index: Entity_7_PK */*=*/create unique index E
19、ntity_7_PK on Entity_7 (Attribute_26 ASC);/*=*/* Table: Entity_8 */*=*/create table Entity_8 ( Attribute_29 char(10) not null, Attribute_30 char(10) null, Attribute_31 char(10) null, constraint PK_ENTITY_8 primary key (Attribute_29);/*=*/* Index: Entity_8_PK */*=*/create unique index Entity_8_PK on
20、Entity_8 (Attribute_29 ASC);/*=*/* Table: Entity_9 */*=*/create table Entity_9 ( Attribute_32 char(10) not null, Attribute_33 char(10) null, constraint PK_ENTITY_9 primary key (Attribute_32);/*=*/* Index: Entity_9_PK */*=*/create unique index Entity_9_PK on Entity_9 (Attribute_32 ASC);/*=*/* Table:
21、前臺 */*=*/create table 前臺 ( 編號 char(10) not null, 姓名 varchar(20) null, constraint PK_前臺 primary key (編號);/*=*/* Index: 前臺_PK */*=*/create unique index 前臺_PK on 前臺 (編號 ASC);/*=*/* Table: 客戶 */*=*/create table 客戶 ( 身份證號 char(18) not null, Attribute_32 char(10) null, 客房號 char(10) null, Attribute_29 char
22、(10) null, 姓名 varchar(20) null, 性別 char(2) null, 地址 long varchar null, 出生日期 timestamp null, 電話 char(11) null, constraint PK_客戶 primary key (身份證號);/*=*/* Index: 客戶_PK */*=*/create unique index 客戶_PK on 客戶 (身份證號 ASC);/*=*/* Index: Relationship_3_FK */*=*/create index Relationship_3_FK on 客戶 (客房號 ASC);
23、/*=*/* Index: Relationship_4_FK */*=*/create index Relationship_4_FK on 客戶 (Attribute_29 ASC);/*=*/* Index: Relationship_5_FK */*=*/create index Relationship_5_FK on 客戶 (Attribute_32 ASC);/*=*/* Table: 客戶住宿 */*=*/create table 客戶住宿 ( Attribute_17 char(10) not null, Attribute_18 char(10) not null, 客房號
24、 char(10) null, 入住時(shí)間 char(10) null, 住宿時(shí)間 char(10) null, 退房時(shí)間 char(10) null, 消費(fèi)費(fèi)用 char(10) null, constraint PK_客戶住宿 primary key (Attribute_17, Attribute_18);/*=*/* Index: 客戶住宿_PK */*=*/create unique index 客戶住宿_PK on 客戶住宿 (Attribute_17 ASC,Attribute_18 ASC);/*=*/* Index: Relationship_6_FK */*=*/create
25、 index Relationship_6_FK on 客戶住宿 (客房號 ASC);/*=*/* Table: 客房 */*=*/create table 客房 ( 客房號 char(10) not null, Attribute_26 char(10) null, 編號 char(10) null, Attribute_34 char(10) not null, 客房類型 char(10) null, 客房狀態(tài) char(10) null, 價(jià)格 char(10) null, constraint PK_客房 primary key (客房號);/*=*/* Index: 客房_PK */
26、*=*/create unique index 客房_PK on 客房 (客房號 ASC);/*=*/* Index: Relationship_1_FK */*=*/create index Relationship_1_FK on 客房 (編號 ASC);/*=*/* Index: Relationship_2_FK */*=*/create index Relationship_2_FK on 客房 (Attribute_26 ASC);/*=*/* Index: Relationship_8_FK */*=*/create index Relationship_8_FK on 客房 (Attribute_34 ASC);alter table Entity_6 add constraint FK_ENTITY_6_RELATIONS_客戶 foreign key (身份證號) references 客戶 (身份證號) on update restrict on delete restrict;alter table 客戶 add constraint FK_客戶_RELATIONS_客房 foreign key (客房號) references 客房 (客房號) on update restri
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年初升高暑期數(shù)學(xué)講義專題07 集合的運(yùn)算重難點(diǎn)突破(含答案)
- 2025年江西省高速公路投資集團(tuán)有限責(zé)任公司招聘筆試備考題庫附答案詳解(輕巧奪冠)
- 2023國家能源投資集團(tuán)有限責(zé)任公司第一批社會(huì)招聘筆試備考試題及一套答案詳解
- 2025福建晉園發(fā)展集團(tuán)有限責(zé)任公司權(quán)屬子公司招聘7人筆試備考題庫含答案詳解(培優(yōu))
- 2025年黑龍江省五常市輔警招聘考試試題題庫有答案詳解
- 2024年湖南有色金屬職業(yè)技術(shù)學(xué)院單招職業(yè)適應(yīng)性測試題庫參考答案
- 2025年河北省定州市輔警招聘考試試題題庫附答案詳解(能力提升)
- 2024年海南健康管理職業(yè)技術(shù)學(xué)院單招職業(yè)傾向性測試題庫(500題)含答案解析
- 2025年K2學(xué)校STEM課程實(shí)施效果評估與教育評價(jià)體系創(chuàng)新實(shí)踐研究分析報(bào)告
- 熱點(diǎn)13+中拉論壇-【探究課堂】備戰(zhàn)2025年中考地理三輪熱點(diǎn)專題復(fù)習(xí)課件
- 中央空調(diào)更換壓縮機(jī)維修合同書
- 微專業(yè)合作建設(shè)協(xié)議
- 《中小學(xué)生時(shí)間規(guī)劃管理主題班會(huì):做時(shí)間的主人》課件(五套)
- (完整版)英語四級詞匯表
- 第五單元 探索1 互聯(lián)網(wǎng)安全風(fēng)險(xiǎn)及其產(chǎn)生原因教學(xué)設(shè)計(jì)-2023-2024學(xué)年蘇科版(2023)初中信息科技七年級下冊
- 工業(yè)污水處理的PLC控制
- GB/T 36548-2024電化學(xué)儲(chǔ)能電站接入電網(wǎng)測試規(guī)程
- 慢性乙型肝炎防治指南(2022年版)
- 人教版(新起點(diǎn))五年級下冊Unit 6 Lesson 3 My Growing-up Story
- 知道網(wǎng)課智慧樹《動(dòng)植物檢驗(yàn)檢疫學(xué)》章節(jié)測試答案
- 知道網(wǎng)課智慧《企業(yè)數(shù)字化營銷》測試答案
評論
0/150
提交評論