




版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
1、數據庫系統課程實踐任務報告任務名稱: 某賓館客房管理系統 班 級: 學 號: 姓 名: 學 號: 姓 名: 完成日期: 2015年06月30日 信息工程學院 計算機系任務名稱:某賓館客房管理系統1任務的描述隨著賓館業競爭的加劇,傳統的賓館計算機管理系統已無法滿足賓館信息化管理的需要。為了拓展經營空間、降低成本和提高管理效率,賓館需要使用更高效的信息化手段,借助先進的計算機信息技術對賓館進行管理。因此為了對某賓館實現客房情況的信息化管理,特設計并實現一個涉及到SQL Server數據庫的重要數據庫對象、功能和特性的某賓館客房管理系統,新的賓館客房管理系統科學的將賓館各種業務完美的結合,方便管理和
2、決策,并且能提供大量的管理經營過程中實際的數據。賓館客房管理系統要求實現以下功能:1、實現客房類型、價目信息、客房信息的管理;2、實現客戶信息的管理;3、實現入住和退房管理;4、實現費用管理;5、創建觸發器,實現入住和退房時自動修改客房的狀態;6、創建存儲過程統計某段時間內各種類型的客房的入住時間合計和費用合計;7、創建視圖查詢某一時刻沒有入住的房間信息;8、建立數據庫相關表之間的參照完整性約束。2需求分析本系統主要包括的外部實體有:客戶、客房信息、客戶住宿、前臺、客房狀態,要實現的功能主要有:客戶、客房等信息的管理。2.1 系統包含的實體根據“任務描述”中提供的信息以及系統需要實現的功能,本
3、系統應包含的實體及其包含的屬性名如下:客戶(身份證號碼,姓名,性別,出生日期,地址)前臺(編號,姓名)客房信息(客房號,客房類型,客房數量,價格,客房狀態)客戶住宿(客房號,客房類型,入住時間,消費費用,住宿時間,退房時間)費用(客房類型,房費,消費費用,押金)入住信息(入住編號,入住時間,入住人數)退房信息(退房編號,退房時間)客房類型(類型編號,類型名稱,價格)樓層信息(樓層編號,樓層名)2.2 系統包含的實體間聯系根據“任務描述”中提供的信息以及賓館的實際情況,本系統中實體之間應有如下的聯系:存在聯系:實體“客戶”與“客房”之間的聯系,包含屬性:客房號。聯系類型:一對多。入住聯系:實體“
4、客戶”與“入住信息”之間的聯系,不包含屬性。聯系類型:一對多。住宿聯系:實體“客房”與“客戶住宿”之間的聯系,包含屬性:客房號,客房類型。聯系類型:一對多。包含聯系:實體“客房”與“客房類型”之間的聯系,不包含屬性。聯系類型:一對多。屬于聯系:實體“客房”與“樓層信息”之間的聯系,不包含屬性。聯系類型:多對多。管理聯系:實體“客戶”與“前臺”之間的聯系,不包含屬性。聯系類型:一對多。2.3 系統需實現的功能 根據“任務描述”中提供的信息以及賓館的實際情況,本系統需具有如下的功能:1、對本系統中具有的實體及實體間聯系的信息存儲;2、具體有如下的靜態查詢:1)對客房信息(客房號、收費標準、類型、入
5、住情況)的查詢:2)對客戶信息(身份證號、居住地址、姓名、性別、出生日期等)的查詢;3)對客戶住宿信息(客房號,客房類型,入住時間,住宿費用,住宿時間,退房時間)的查詢;4)對客房狀態(入住、退房)的查詢;3、具體有如下的動態查詢:1)給定身份證號碼,查詢該客戶的身份信息、客戶住宿信息;2)給定客房號,查詢該客房的信息、客房狀態;2.4 數據流圖根據“需要分析”中對本系統包含的實體及需要實現的功能的描述,設計并繪制出本系統的數據流圖如下:(1)第一層數據流圖(2)第二層數據流圖2.5 數據字典根據數據流圖中的實體、數據存儲,本系統需要如下數據字典:(1)數據字典名:客戶表示的對象:客戶實體數據
6、結構:客戶=姓名(字符串類型)+性別(字符串類型)+地址(字符串類型)+出生日期(日期類型)+身份證號(字符串類型)+電話(字符串類型)(2)數據字典名:前臺表示的對象:前臺實體數據結構:前臺=姓名(字符串類型)+性別(字符串類型)(3)數據字典名:客房表示的對象:客房實體數據結構:客房=客房號(整型)+客房類型(字符串類型)+客房數量(整型)+價格(整型)+客房狀態(字符串類型)(4)數據字典名:客戶住宿表示的對象:客戶住宿實體數據結構:客戶住宿=客房號(整型)+客房類型(字符串類型)+住宿時間(字符串類型)+消費費用(整型)+入住時間(字符串類型)+退房時間(字符串類型)(5)數據字典名:
7、客房類型 表示的對象:客房類型實體數據結構:客房類型=類型編號(字符串類型)+類型名稱(整型)(6)數據字典名:賬單信息表示的對象:賬單信息實體數據結構:賬單信息=客房類型(字符串類型)+消費費用(整型)+房費(整型)+押金(整型)(7)數據字典名:入住信息表示的對象:入住信息實體數據結構:入住信息=入住編號(定長字符串類型)+入住人數(整型)+ 入住時間(字符串類型)(8)數據字典名:退房信息表示的對象:退房信息實體數據結構:退房信息=退房編號(定長字符串類型)+ 退房時間(字符串類型)(9)數據字典名:樓層信息表示的對象:樓層信息實體數據結構:樓層信息=樓層編號(定長字符串類型)+ 樓層名
8、(字符串類型)3. 數據庫概念數據模型設計根據“需求分析”中對本系統包含的實體及實體間聯系的描述,本系統的數據庫概念數據模型圖如下:4數據庫邏輯數據模型設計此處根據數據庫概念數據模型和數據庫概念模型向關系數據庫模型轉換的規則,生成出系統的數據庫邏輯數據模型。5. 數據庫物理數據模型設計此處根據數據庫概念數據模型生成數據庫物理數據模型后,截圖粘貼到此處。6建立數據庫的SQL代碼if exists(select 1 from sys.sysforeignkey where role=FK_ENTITY_6_RELATIONS_客戶) then alter table Entity_6 delete
9、 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 table 客戶 delete foreign key F
10、K_客戶_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_客房) then alter table 客戶住宿 delete foreign key FK_客戶
11、住宿_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_7) then alter table 客房 delete foreign key FK_客房_RELATIONS_ENTITY_
12、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 exists Entity_10;drop index if exists Entity_6.Relationship_7_FK;drop index if exists
13、 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 Entity_9.Entity_9_PK;drop table if exists Entity_9;drop index if exists 前臺.前臺_PK;dr
14、op 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 exists 客戶住宿.Relationship_6_FK;drop index if exists 客戶住宿.客戶住宿_PK;drop table if exists
15、 客戶住宿;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 */*=*/create table Entity_10 ( Attribute_34 char(10) not null, Attribute_35 char(10) null,
16、 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(10) not null, 身份證號 char(18) null, Attribute_22 char(10) null, Attribute_23 char
17、(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 */*=*/create index Relationship_7_FK on Entity_6 (身份證號 ASC);/*=*/* Table: Entity_7 *
18、/*=*/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 Entity_7_PK on Entity_7 (Attribute_26 ASC);/*=*/* Table: Entity_8 */*=*/create ta
19、ble 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 Entity_8 (Attribute_29 ASC);/*=*/* Table: Entity_9 */*=*/create table Entity_9 (
20、 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: 前臺 */*=*/create table 前臺 ( 編號 char(10) not null, 姓名 varchar(20) null, constraint
21、 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(10) null, 姓名 varchar(20) null, 性別 char(2) null, 地址 long varchar null, 出生日期 time
22、stamp 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);/*=*/* Index: Relationship_4_FK */*=*/create index Relationship_4_FK on 客戶 (Attr
23、ibute_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, 客房號 char(10) null, 入住時間 char(10) null, 住宿時間 char(10) null, 退房時間 char(10) null, 消費費用
24、 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 index Relationship_6_FK on 客戶住宿 (客房號 ASC);/*=*/* Table: 客房 */*=*/create table 客
25、房 ( 客房號 char(10) not null, Attribute_26 char(10) null, 編號 char(10) null, Attribute_34 char(10) not null, 客房類型 char(10) null, 客房狀態 char(10) null, 價格 char(10) null, constraint PK_客房 primary key (客房號);/*=*/* Index: 客房_PK */*=*/create unique index 客房_PK on 客房 (客房號 ASC);/*=*/* Index: Relationship_1_FK */
26、*=*/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 restrict on de
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
- 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 上海建設管理職業技術學院《外匯交易模擬》2023-2024學年第二學期期末試卷
- 福州英華職業學院《園林建筑設計Ⅱ》2023-2024學年第二學期期末試卷
- 寧夏幼兒師范高等專科學校《副教學訓練理論與實踐(1)》2023-2024學年第二學期期末試卷
- 北京理工大學《建筑消防設備工程》2023-2024學年第二學期期末試卷
- 西安航空職業技術學院《自動控制原理B實驗》2023-2024學年第二學期期末試卷
- 濰坊食品科技職業學院《德育原理》2023-2024學年第二學期期末試卷
- 廣州涉外經濟職業技術學院《意識形態前沿問題研究》2023-2024學年第二學期期末試卷
- 民辦合肥財經職業學院《精神病護理學》2023-2024學年第二學期期末試卷
- 贛州師范高等專科學校《面向對象程序設計-JAVA語言》2023-2024學年第二學期期末試卷
- 天津外國語大學《原理與應用實訓》2023-2024學年第二學期期末試卷
- 2025年浙江高考地理二輪專題考點4 天體觀測 (課件)
- 2025-2030不粘鍋市場行業市場現狀供需分析及投資評估規劃分析研究報告
- 螺栓連接在橫向振動下的松動機制與力學分析
- 101二元一次方程組的概念【9個必考點】(必考點分類集訓)(人教版2024)(原卷版)
- 大型心血管造影系統及其DSA質量控制
- (高清版)DB33∕T 386-2013 內河航道工程質量檢驗規范
- 鋁加工深井鑄造培訓
- 國家中小學智慧教育平臺應用指南
- 2024-2025學年人教版七年級(下)期中數學試卷(考試范圍:第7~9章) (含解析)
- 無人機噴灑系統設計-全面剖析
- 人工智能安全監控系統開發協議
評論
0/150
提交評論