ImageVerifierCode 换一换
格式:DOCX , 页数:15 ,大小:19.75KB ,
资源ID:23562160      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/23562160.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(景点门票销售管理系统数据库设计.docx)为本站会员(b****8)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

景点门票销售管理系统数据库设计.docx

1、景点门票销售管理系统数据库设计景点门票销售管理系统数据库设计学生姓名: 李丙崇 学 号:_学生姓名: 任欣月 学 号:_专 业: 计算机科学与技术指导老师: 于宝华 1引言1.1编写目的 1.2背景.1.3参考资料 2需求分析2.1目标 2.2运算坏境 2.3需求概述 3结构设计3.1逻辑结构设计 3.1.1局部E-R图3.1.2全局E-R图3.1.3关系模式3.1.1关系图3.2物理结构设计.4.存储过程4.1统计指定日期的门票销售情况 4.2统计指定月份的门票销售情况 4.3统计指定日期各种价格的门票销售情况 4.3统计指定营业员指定日期的收费情况 5触发器6完整性约束 7.数据库备份1引

2、言随着全球信息化的发展,我们也步入信息时代,各类管理也更加系统化,公司利用管理 信息系统来管理各类业务已经非常普遍。各类系统也相应的得到飞速发展,为了让我们的管理 更加系统,更加清晰,更加科学,从而也开发了一个简单,易操作的管理管理系统。1.1编写目的根据门票销售管理的特点,对被开发软件系统的主要功能、性能进行完整描述,为软件开 发进行详细设计和编程提供基础。为软件提供测试和验收的依据,即为选取测试用例和进行验 收的依据。1.2背景a.该软件系统的名称:门票管理信息系统;b.本项目的任务提出者:石河子大学c.本项目的开发者:李丙崇,任欣月d.本项目用户:景点门票销售部1.3参考资料1王珊,萨师

3、煊.数据库系统概论M.高等教育出版社,2006年5月第4版2郑人杰,马素霞,殷人昆.软件工程概率M.机械工业出版社,2009年11月3马晓梅.SQL Server实验指导M.清华大学出版社,2009年9月第3版2 需求分析2.1目标这个门票管理系统主要是处理旅客买票,订票,退票,以及各类查询结算。该系统针对的 用户是门票销售部门,由于门票销售,查询以及计算各天或者不同时间段的收入比较繁琐,此 系统方便简单的实现了这些功能,使得管理员与职工方便很多,让这个门票销售都变得条条有 理。2.2运算坏境(1)软件资源服务器端软件选择的具体说明:操作系统: Windows 2007 Server 或 Wi

4、ndows XP。数据库管理系统: SQL Server 。开发工具: visual studio 2008.软件平台: windows+iis+mssql 。客户端软件选择的具体说明:web浏览器。2.3需求概述本系统的开发是为了提高门票销售以及管理的效率,尽可能杜绝各个销售环节中可能出 现的资金流失不明现象,满足系统化的门票管理域收入需求。系统功能主要包括:登陆管理 (包括管理员登陆以及职工登陆,职工注册情况),系统管理(系统启用,及其系统截止), 直接销售(个人购买与团购),订票管理(订票与查看订票状态),退票管理(处理当天所要 退的票),查询管理(按时间查询,按职工号查询,游客种类查询

5、,按时间票号查询,按时间, 职工号查询,按时间,游客种类查询,以及当天销售查询),结算管理(具体时间查询以及时 间段查询),最后是系统简介。3结构设计3.1逻辑结构设计图4.营业员E-R图图5.游客E-R图图6.门票E-R图图7.门票类型E-R图图8总体E-R图3.1.1 局部E-R图3.1.2全局E-R图3.1.3关系模式Admin_T( Sell_operator,User name,password,Sex,ReaIname,Cardnumber,Age,Phone,Use r_type)该表为管理表,表项包括销售营业员,用户姓名,密码,性别,真实姓名,卡号,年 龄,电话号码,用户类型的

6、信息。主键为销售营业员。Dd_T( Order ID,Custom ID,Ticker ID,Ticker type,Ticker Price,Sell operator,Sell date,Sell_mo nth)该表为订单表,表项有订单号,游客号,门票号,门票类型,门票价格,销售营业员, 销售日期和销售月份。该表的主键为订单号,外键有游客号,门票号,门票类型,门票价 格和销售营业员。Custom_TCustom_ID,Custom _n ame,Sex,Age,Card nu mber,Custom_type,Custom_pho ne)该表为游客信息表,表项有游客号,游客姓名,身份证号,

7、游客类型,游客电话。该表 主键为游客号,无外键。Ticket_summary (Sell_ID,Ticket type, Sell_amou nt,Sell_m on ey,Sell_m on th)该表为门票信息统计表,表项有出售号码,门票类型,出售时间,出售月份,出售价 格。该表主键为出售号,外键为门票类型。Ticket_T (Ticket_type,Ticket_type_name,Ticket_price,Ticket_Count,Ticket_comment, Date)该表为门票信息表,表项有门票类型,类型名,门票价格,门票数量,日期。主键为门票类型,无外键。Ticket_List

8、 (Ticket_ID,Ticket_type,Sell_flag)该表为门票属性信息表,表项为门票号,门票类型,和是否出售标记。主键为门票号, 外键为门票类型。3.2物理结构设计表 1 Admin_T 表列名数据类型允许空Sell_operatorn varchar(10)NO NULLUser_ namevarchar(20)NO NULLPasswordvarchar(20)NO NULLSexchar(5)NULLRealn amevarchar(20)NULLcard numberchar(18)NULLAgeintNULLPhonechar(11)NULLUser_typechar

9、(10)NULL表 2 Custom_T 表列名数据类型允许空Custo mDchar(10)NO NULLCustom_ namevarchar(20)NO NULLSexchar(5)NULLAgeintNULLCard numberchar(18)NULLCustom typechar(10)NULLCustom ph onechar(11)NULL表3dd_T表列名数据类型允许空Order_IDchar(10)NO NULLCusto mDchar(10)NO NULLTicket_IDchar(17)NO NULLTicket_typechar(3)NO NULLTicket_Pri

10、cedecimal(5,2)NO NULLSell_operatorn varchar(10)NO NULLSell_datedatetimeNO NULLSell_mo nthn varchar(10)NO NULL表 4 Ticket_List 表列名数据类型允许空Ticket_IDchar(17)NO NULLTicket_typechar (3)NULLSell_flagintNULL表 5 Ticket_summary 表列名数据类型允许空SellDchar(20)NO NULLTicket_typechar (3)NO NULLSell_datedatetimeNULLSell_a

11、mou ntintNULLSell_m oneydecimal(5,2)NULLSell_mo nthn varchar(10)NULL表 6 Ticket_T 表列名数据类型允许空Ticket_typechar (3)NULLTicket_type_ namechar(50)NULLTicket_pricedecimal(5,2)NO NULLTicket_Cou ntintNO NULLTicket comme ntchar(200)NO NULLDatedatetimeNO NULL4.存储过程4.1统计指定日期的门票销售情况create Procedure Pro_QTics infs

12、tarttime datetime,e ndtime datetime,sSell_am oun t_out int output,sSell_m on ey_out decimal 2) outputAS select sSell_amou nt_out=co un t(Ticket_ID),sSell_m on ey_out=sum(dd_T.Ticket_Price)from dd_T,Ticket_Twhere Ticket_T.Ticket_type=dd_T.Ticket_type and Sell_date betwee n starttime anden dtimedeclar

13、e starttime datetime, en dtime datetime,sSell_am oun t_out int ,sSell_m on ey_out decimal(5, 2)select starttime=2013/1/13 00:00:00select e ndtime=2013/1/13 19:40:00exec Pro_QTicsi nf starttime,e ndtime,sSell_a mount_out output,sSell_m on ey_out outputselect sSell_amount_out as 门票数量 ,sSell_money_out

14、as 金额4.2 统计指定月份的门票销售情况create 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_mont

15、h=sSell_month declare sSell_month nvarchar(10),sSell_amount_out int,sSell_money_out decimal(5, 2)select sSell_month=2013/1exec Pro_QTicsminf sSell_month,sSell_amount_out output,sSell_money_out output select sSell_amount_out as 门票数量 ,sSell_money_out as 金额4.3统计指定日期各种价格的门票销售情况create Procedure Pro_QTics

16、Pinfstarttime datetime,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 selectsTicket_Price_out=Ticket_Price,sSell_amount_out=count(Ticket_ID), sSell_money_out=sum(dd_T.Ticket_Price) from dd_Twhere sTicke

17、t_type=dd_T.Ticket_type and Sell_date between starttime and endtime group 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

18、 19:40:00select sTicket_type=T01exec 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 门票数量,sSell_m on ey_out as 门票金额select sTicket_type=T02exec Pro_QTicsPinf starttime,endtime,sTi

19、cket_type,sTicket_Price_outoutput,sSell_amount_out output,sSell_money_out outputselect sTicket_Price_out as 门票价格,sSell_amount_out as 门票数量,sSell_m on ey_out as 门票金额select sTicket_type=T03exec Pro_QTicsPinf starttime,endtime,sTicket_type,sTicket_Price_outoutput,sSell_amount_out output,sSell_money_out

20、outputselect sTicket_Price_out as 门票价格,sSell_amount_out as 门票数量,sSell_m on ey_out as 门票金额4.3统计指定营业员指定日期的收费情况create Procedure Pro_QTicsCinfstarttime datetime,endtime datetime, sSell_operator nvarchar(10),sSell_amount_out int output,sSell_money_out decimal(5, 2) outputAS selectsSell_amount_out=count(T

21、icket_ID),sSell_money_out=sum(dd_T.Ticket_Price)from dd_Twhere sSell_operator=dd_T.Sell_operator and Sell_date between starttime andendtimegroup by Sell_operatordeclare starttime datetime, endtime datetime,sSell_operator nvarchar(10),sSell_amount_out int , sSell_money_out decimal(5, 2)select startti

22、me=2013/1/13 00:00:00select endtime=2013/1/13 23:40:00select sSell_operator=001exec Pro_QTicsCinf starttime,endtime,sSell_operator,sSell_amount_out output,sSell_money_out outputselect sSell_operator as 营业员 ,sSell_amount_out as 销售门票数量,sSell_money_out as 收费总金额select sSell_operator=002exec Pro_QTicsCin

23、f starttime,endtime,sSell_operator,sSell_amount_out output,sSell_money_out outputselect sSell_operator as 营业员,sSell_amount_out as 销售门票数量,sSell_money_out as 收费总金额5 触发器a.有人买票时,自动更改门票标志位create trigger TRIGGER_BUY_TICon dd_T for insertasbeginDeclare Ticket_ID_IN char(17)Select Ticket_ID_IN=Ticket_ID fro

24、m 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.若有人退票,对各表所有有关该人的信息进行级联删除create trigger TRiGGER_EXIT_TICon dd_T for deleteasbeginDeclare Order_ID_DEL char(10),Custom_ID_DEL char(10),Ticket_ID_ALT

25、 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_ALTdelete from Custom_Twhere Custom_ID=Custom_ID_DELendgoDELETE from dd_T where Order_ID=O006c.当门票销售时自动减少该该类型门票的总量create trigger tri_Tic_Sello

26、n Ticket_summary for insertas declare oldcount int,newcount int,sTicket_type char(3)select sTicket_type=Ticket_type,newcount=Sell_amount from insertedselect oldcount=Ticket_Count from Ticket_T where Ticket_type=sTicket_typeif newcount0 and oldcount0beginupdate Ticket_T set Ticket_Count=oldcount-newc

27、ount where Ticket_type=sTicket_typereturnendrollback transactioninsert into Ticket_summary values(C0004,T01,2013-01-17 18:47, 002,2,40,2013-01)d.当门票修改类型时自动修改门票各类型的数量 create trigger tri_Ticxgon Ticket_List for updateas declare sTic_ID char(17),sTicket_type char(3),saTicket_type char(3),scount int,sac

28、ount intselect sTicket_type=Ticket_type,sTic_ID=Ticket_ID from insertedselect saTicket_type=Ticket_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

29、Ticket_T set Ticket_Count=scount+1 where Ticket_type=sTicket_type returnupdate Ticket_T set Ticket_COunt=sacount-1 where Ticket_type=saTicket_type returnendrollback transactionupdate Ticket_List set Ticket_type=T02 where Ticket_ID=S00016 完整性约束USE Attraction_Managegoalter table Admin_T with checkadd constraint CHECK_SEX check(Sex= 男 or Sex= 女 ),constraint CHECK_AGE check(Age=0)goalter table Custom_T with checkadd constraint CHECK1_SEX check(Sex= 男 or Sex= 女),constraint CHECK1_AGE check(Age=0)goalter table Admin_alter table Ticket_summary with check

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1