景點門票銷售管理系統(tǒng)數(shù)據(jù)庫設(shè)計_第1頁
景點門票銷售管理系統(tǒng)數(shù)據(jù)庫設(shè)計_第2頁
景點門票銷售管理系統(tǒng)數(shù)據(jù)庫設(shè)計_第3頁
景點門票銷售管理系統(tǒng)數(shù)據(jù)庫設(shè)計_第4頁
景點門票銷售管理系統(tǒng)數(shù)據(jù)庫設(shè)計_第5頁
已閱讀5頁,還剩12頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

1、景點門票銷售管理系統(tǒng)數(shù)據(jù)庫設(shè)計學(xué)生姓名: 李丙崇 學(xué) 號: 2010508009 學(xué)生姓名: 任欣月 學(xué) 號: 2010508041 專 業(yè):計算機科學(xué)與技術(shù) 指導(dǎo)老師: 于寶華 目錄1引言31.1編寫目的31.2背景31.3 參考資料32需求分析42.1目標42.2運算壞境42.3 需求概述43結(jié)構(gòu)設(shè)計53.1邏輯結(jié)構(gòu)設(shè)計53.1.1 局部 E-R 圖53.1.2 全局 E-R 圖6關(guān)系模式7關(guān)系圖83.2物理結(jié)構(gòu)設(shè)計84.存儲過程104.1統(tǒng)計指定日期的門票銷售情況104.2統(tǒng)計指定月份的門票銷售情況104.3統(tǒng)計指定日期各種價格的門票銷售情況114.3統(tǒng)計指定營業(yè)員指定日期的收費情況12

2、5 觸發(fā)器136完整性約束157.數(shù)據(jù)庫備份161引言隨著全球信息化的發(fā)展,我們也步入信息時代,各類管理也更加系統(tǒng)化,公司利用管理信息系統(tǒng)來管理各類業(yè)務(wù)已經(jīng)非常普遍。各類系統(tǒng)也相應(yīng)的得到飛速發(fā)展,為了讓我們的管理更加系統(tǒng),更加清晰,更加科學(xué),從而也開發(fā)了一個簡單,易操作的管理管理系統(tǒng)。1.1編寫目的根據(jù)門票銷售管理的特點,對被開發(fā)軟件系統(tǒng)的主要功能、性能進行完整描述,為軟件開發(fā)進行詳細設(shè)計和編程提供基礎(chǔ)。為軟件提供測試和驗收的依據(jù),即為選取測試用例和進行驗收的依據(jù)。1.2背景a.該軟件系統(tǒng)的名稱:門票管理信息系統(tǒng);b.本項目的任務(wù)提出者:石河子大學(xué)c.本項目的開發(fā)者:李丙崇,任欣月d.本項目用

3、戶:景點門票銷售部1.3 參考資料 1王珊,薩師煊.數(shù)據(jù)庫系統(tǒng)概論M.高等教育出版社,2006年5月第4版2鄭人杰,馬素霞,殷人昆.軟件工程概率M.機械工業(yè)出版社,2009年11月3馬曉梅.SQL Server實驗指導(dǎo)M.清華大學(xué)出版社,2009年9月第3版2需求分析2.1目標這個門票管理系統(tǒng)主要是處理旅客買票,訂票,退票,以及各類查詢結(jié)算。該系統(tǒng)針對的用戶是門票銷售部門,由于門票銷售,查詢以及計算各天或者不同時間段的收入比較繁瑣,此系統(tǒng)方便簡單的實現(xiàn)了這些功能,使得管理員與職工方便很多,讓這個門票銷售都變得條條有理。2.2運算壞境(1)軟件資源服務(wù)器端軟件選擇的具體說明:操作系統(tǒng):Windo

4、ws 2007 Server 或 Windows XP。數(shù)據(jù)庫管理系統(tǒng):SQL Server。開發(fā)工具:visual studio 2008.軟件平臺:windows+iis+mssql??蛻舳塑浖x擇的具體說明:web瀏覽器。2.3 需求概述本系統(tǒng)的開發(fā)是為了提高門票銷售以及管理的效率,盡可能杜絕各個銷售環(huán)節(jié)中可能出現(xiàn)的資金流失不明現(xiàn)象,滿足系統(tǒng)化的門票管理域收入需求。系統(tǒng)功能主要包括:登陸管理(包括管理員登陸以及職工登陸,職工注冊情況),系統(tǒng)管理(系統(tǒng)啟用,及其系統(tǒng)截止),直接銷售(個人購買與團購),訂票管理(訂票與查看訂票狀態(tài)),退票管理(處理當(dāng)天所要退的票),查詢管理(按時間查詢,按職

5、工號查詢,游客種類查詢,按時間票號查詢,按時間,職工號查詢,按時間,游客種類查詢,以及當(dāng)天銷售查詢),結(jié)算管理(具體時間查詢以及時間段查詢),最后是系統(tǒng)簡介。3結(jié)構(gòu)設(shè)計3.1邏輯結(jié)構(gòu)設(shè)計3.1.1 局部 E-R 圖圖4. 營業(yè)員E-R圖圖5. 游客E-R圖圖6. 門票E-R圖圖7. 門票類型E-R圖3.1.2 全局 E-R 圖圖8總體E-R圖3.1.3關(guān)系模式Admin_T( Sell_operator,User_name,password,Sex,Realname,Cardnumber,Age,Phone,User_type)該表為管理表,表項包括銷售營業(yè)員,用戶姓名,密碼,性別,真實姓名,

6、卡號,年齡,電話號碼,用戶類型的信息。主鍵為銷售營業(yè)員。Dd_T( Order_ID,Custom_ID,Ticker_ID,Ticker_type,Ticker_Price,Sell_operator,Sell_date,Sell_month)該表為訂單表,表項有訂單號,游客號,門票號,門票類型,門票價格,銷售營業(yè)員,銷售日期和銷售月份。該表的主鍵為訂單號,外鍵有游客號,門票號,門票類型,門票價格和銷售營業(yè)員。Custom_T(Custom_ID,Custom_name,Sex,Age,Cardnumber,Custom_type,Custom_phone)該表為游客信息表,表項有游客號,游

7、客姓名,身份證號,游客類型,游客電話。該表主鍵為游客號,無外鍵。Ticket_summary(Sell_ID,Ticket_type, Sell_amount,Sell_money,Sell_month)該表為門票信息統(tǒng)計表,表項有出售號碼,門票類型,出售時間,出售月份,出售價格。該表主鍵為出售號,外鍵為門票類型。Ticket_T(Ticket_type,Ticket_type_name,Ticket_price,Ticket_Count,Ticket_comment,Date)該表為門票信息表,表項有門票類型,類型名,門票價格,門票數(shù)量,日期。主鍵為門票類型,無外鍵。Ticket_List(

8、Ticket_ID,Ticket_type,Sell_flag)該表為門票屬性信息表,表項為門票號,門票類型,和是否出售標記。主鍵為門票號,外鍵為門票類型。關(guān)系圖3.2物理結(jié)構(gòu)設(shè)計表1 Admin_T表列名數(shù)據(jù)類型允許空Sell_operatornvarchar(10)NO NULLUser_namevarchar(20)NO NULLPasswordvarchar(20)NO NULLSexchar(5)NULLRealnamevarchar(20)NULLcardnumberchar(18)NULLAgeintNULLPhonechar(11)NULLUser_typechar(10)NU

9、LL表2 Custom_T表列名數(shù)據(jù)類型允許空Custom_IDchar(10)NO NULLCustom_namevarchar(20)NO NULLSexchar(5)NULLAgeintNULLCardnumberchar(18)NULLCustom_typechar(10)NULLCustom_phonechar(11)NULL表3 dd_T表列名數(shù)據(jù)類型允許空Order_IDchar(10)NO NULLCustom_IDchar(10)NO NULLTicket_IDchar(17)NO NULLTicket_typechar(3)NO NULLTicket_Pricedecima

10、l(5,2)NO NULLSell_operatornvarchar(10)NO NULLSell_datedatetimeNO NULLSell_monthnvarchar(10)NO NULL表4 Ticket_List表列名數(shù)據(jù)類型允許空Ticket_IDchar(17)NO NULLTicket_typechar(3)NULLSell_flagintNULL表5 Ticket_summary表列名數(shù)據(jù)類型允許空Sell_IDchar(20)NO NULLTicket_typechar(3)NO NULLSell_datedatetimeNULLSell_amountintNULLSel

11、l_moneydecimal(5,2)NULLSell_monthnvarchar(10)NULL表6 Ticket_T表列名數(shù)據(jù)類型允許空Ticket_typechar(3)NULLTicket_type_name char(50)NULLTicket_pricedecimal(5,2)NO NULLTicket_CountintNO NULLTicket_commentchar(200)NO NULLDatedatetimeNO NULL4.存儲過程4.1統(tǒng)計指定日期的門票銷售情況create Procedure Pro_QTicsinfstarttime datetime,endtime

12、 datetime,sSell_amount_out int output,sSell_money_out decimal(5, 2) outputAS select sSell_amount_out=count(Ticket_ID),sSell_money_out=sum(dd_T.Ticket_Price)from dd_T,Ticket_Twhere Ticket_T.Ticket_type=dd_T.Ticket_type and Sell_date between starttime and endtimedeclare starttime datetime, endtime dat

13、etime,sSell_amount_out int ,sSell_money_out decimal(5, 2) select starttime='2013/1/13 00:00:00'select endtime='2013/1/13 19:40:00'exec Pro_QTicsinf starttime,endtime,sSell_amount_out output,sSell_money_out outputselect sSell_amount_out as 門票數(shù)量,sSell_money_out as 金額4.2統(tǒng)計指定月份的門票銷售情況cre

14、ate Procedure Pro_QTicsminfsSell_month nvarchar(10),sSell_amount_out int output,sSell_money_out decimal(5, 2) outputAS select sSell_amount_out=count(Ticket_ID),sSell_money_out=sum(dd_T.Ticket_Price)from dd_T,Ticket_Twhere Ticket_T.Ticket_type=dd_T.Ticket_type and Sell_month=sSell_monthdeclare sSell_

15、month nvarchar(10),sSell_amount_out int,sSell_money_out decimal(5, 2) select sSell_month='2013/1'exec Pro_QTicsminf sSell_month,sSell_amount_out output,sSell_money_out outputselect sSell_amount_out as 門票數(shù)量,sSell_money_out as 金額4.3統(tǒng)計指定日期各種價格的門票銷售情況create Procedure Pro_QTicsPinfstarttime datet

16、ime,endtime datetime, sTicket_type char(3),sTicket_Price_out decimal(5, 2) output,sSell_amount_out int output,sSell_money_out decimal(5, 2) outputAS select sTicket_Price_out=Ticket_Price,sSell_amount_out=count(Ticket_ID),sSell_money_out=sum(dd_T.Ticket_Price)from dd_Twhere sTicket_type=dd_T.Ticket_t

17、ype and Sell_date between starttime and endtimegroup by Ticket_Pricedeclare starttime datetime, endtime datetime,sTicket_type char(3),sTicket_Price_out decimal(5, 2),sSell_amount_out int ,sSell_money_out decimal(5, 2) select starttime='2013/1/13 00:00:00 'select endtime='2013/1/13 19:40:

18、00'select sTicket_type='T01'exec Pro_QTicsPinf starttime,endtime,sTicket_type,sTicket_Price_out output,sSell_amount_out output,sSell_money_out outputselect sTicket_Price_out as 門票價格,sSell_amount_out as 門票數(shù)量,sSell_money_out as 門票金額select sTicket_type='T02'exec Pro_QTicsPinf startt

19、ime,endtime,sTicket_type,sTicket_Price_out output,sSell_amount_out output,sSell_money_out outputselect sTicket_Price_out as 門票價格,sSell_amount_out as 門票數(shù)量,sSell_money_out as 門票金額select sTicket_type='T03'exec Pro_QTicsPinf starttime,endtime,sTicket_type,sTicket_Price_out output,sSell_amount_ou

20、t output,sSell_money_out outputselect sTicket_Price_out as 門票價格,sSell_amount_out as 門票數(shù)量,sSell_money_out as 門票金額4.3統(tǒng)計指定營業(yè)員指定日期的收費情況create Procedure Pro_QTicsCinfstarttime datetime,endtime datetime, sSell_operator nvarchar(10),sSell_amount_out int output,sSell_money_out decimal(5, 2) outputAS select

21、sSell_amount_out=count(Ticket_ID),sSell_money_out=sum(dd_T.Ticket_Price)from dd_Twhere sSell_operator=dd_T.Sell_operator and Sell_date between starttime and endtimegroup by Sell_operatordeclare starttime datetime, endtime datetime,sSell_operator nvarchar(10),sSell_amount_out int ,sSell_money_out dec

22、imal(5, 2) select starttime='2013/1/13 00:00:00'select endtime='2013/1/13 23:40:00'select sSell_operator='001'exec Pro_QTicsCinf starttime,endtime,sSell_operator,sSell_amount_out output,sSell_money_out outputselect sSell_operator as 營業(yè)員,sSell_amount_out as 銷售門票數(shù)量,sSell_money_

23、out as 收費總金額select sSell_operator='002'exec Pro_QTicsCinf starttime,endtime,sSell_operator,sSell_amount_out output,sSell_money_out outputselect sSell_operator as 營業(yè)員,sSell_amount_out as 銷售門票數(shù)量,sSell_money_out as 收費總金額5 觸發(fā)器a.有人買票時,自動更改門票標志位create triggerTRIGGER_BUY_TICon dd_T for insertasbegi

24、nDeclare Ticket_ID_IN char(17)Select Ticket_ID_IN=Ticket_ID from insertedupdate Ticket_List set Sell_flag=1where Ticket_ID=Ticket_ID_INendinsert into dd_T values('O006','1005','S0006','T02',40,'001','2013/2/13 19:50:00','2013/2')b.若有人退票,對各表所有有關(guān)

25、該人的信息進行級聯(lián)刪除create trigger TRiGGER_EXIT_TICon dd_T for deleteas beginDeclare Order_ID_DEL char(10),Custom_ID_DEL char(10),Ticket_ID_ALT char(17)Select Order_ID_DEL=Order_ID,Custom_ID_DEL=Custom_ID,Ticket_ID_ALT=Ticket_ID from deletedupdate Ticket_List set Sell_flag=0where Ticket_ID=Ticket_ID_ALTdelet

26、e from Custom_Twhere Custom_ID=Custom_ID_DELendgoDELETE from dd_T where Order_ID='O006'c.當(dāng)門票銷售時自動減少該該類型門票的總量create trigger tri_Tic_Sellon Ticket_summary for insertas declare oldcount int,newcount int,sTicket_type char(3)select sTicket_type=Ticket_type,newcount=Sell_amount from insertedselect

27、 oldcount=Ticket_Count from Ticket_T where Ticket_type=sTicket_typeif newcount>0 and oldcount>0beginupdate Ticket_T set Ticket_Count=oldcount-newcount where Ticket_type=sTicket_typereturnendrollback transactioninsert into Ticket_summary values('C0004','T01','2013-01-17 18:4

28、7', '002',2,40,'2013-01')d.當(dāng)門票修改類型時自動修改門票各類型的數(shù)量create trigger tri_Ticxgon Ticket_List for updateas declare sTic_ID char(17),sTicket_type char(3),saTicket_type char(3),scount int,sacount intselect sTicket_type=Ticket_type,sTic_ID=Ticket_ID from insertedselect saTicket_type=Ticket_

29、type from Ticket_List where Ticket_ID=sTic_IDselect scount=Ticket_Count from Ticket_T where Ticket_type=sTicket_typeselect sacount=Ticket_Count from Ticket_T where Ticket_type=saTicket_typebeginupdate Ticket_T set Ticket_Count=scount+1 where Ticket_type=sTicket_typereturnupdate Ticket_T set Ticket_COunt=sacount-1 where Ticket_type=saTicket_typereturnendrollback transactionupdate Ticket_List set Ticket_type='T02' where Ticket_ID='S0001'6完整性約束USE Attraction_Managegoalter table Admin_T with checkadd constraint CHECK_SEX check(Sex=&

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論