图书馆管理系统powerdesigner.docx

上传人:b****3 文档编号:4807687 上传时间:2022-12-09 格式:DOCX 页数:15 大小:115.44KB
下载 相关 举报
图书馆管理系统powerdesigner.docx_第1页
第1页 / 共15页
图书馆管理系统powerdesigner.docx_第2页
第2页 / 共15页
图书馆管理系统powerdesigner.docx_第3页
第3页 / 共15页
图书馆管理系统powerdesigner.docx_第4页
第4页 / 共15页
图书馆管理系统powerdesigner.docx_第5页
第5页 / 共15页
点击查看更多>>
下载资源
资源描述

图书馆管理系统powerdesigner.docx

《图书馆管理系统powerdesigner.docx》由会员分享,可在线阅读,更多相关《图书馆管理系统powerdesigner.docx(15页珍藏版)》请在冰豆网上搜索。

图书馆管理系统powerdesigner.docx

图书馆管理系统powerdesigner

 

 

本科学生设计性实验报告

 

数据库课程设计

 

学院:

软通学院

课程名称:

数据库课程设计

专业班级:

姓名:

学号:

开课学期2013至2014学年第二学期

 

学生实验报告

(一)

学生姓名

学号

同组人:

实验项目

图书馆系统

√必修□选修

□演示性实验□验证性实验√操作性实验□综合性实验

实验地点

实验仪器台号

指导教师

陈辉

实验日期及节次

一、实验综述

一、实验任务

1)以图书信息管理系统为例,开展数据库系统设计 

2)使用Java语言开发相关系统界面,实现系统相关功能 

3)完成系统测试

二、实验要求(系统功能要求)

1)人员管理:

读者、图书管理员、系统管理员,管理的内容包括人员增、删、查、改; 

2)书籍管理:

采购、入库、预约、借阅、续借、归还、查询、统计、读书评论。

 

3)仓库管理:

管理图书馆藏信息 

4)供应商管理:

管理图书供应商 

5)财务管理:

管理图书采购帐目

三、实验仪器、设备或软件

仪器设备:

电脑一台

数据库系统设计:

Powerdesigner

Java开发工具:

 JDK1.6或以上 Eclipse 或者NetBeans

系统测试:

人工测试

二、实验过程(编程,调试,运行;请写上源码,要求要有注释)1.

1.ER图

2.逻辑结构

 

3.物理结构

代码部分

建表命令

/*==============================================================*/

/*Table:

仓库*/

/*==============================================================*/

createtable仓库(

仓库编号char(10)notnull,

图书数量intnull,

constraintPK_仓库primarykeynonclustered(仓库编号)

go

/*==============================================================*/

/*Table:

供货单位*/

/*==============================================================*/

createtable供货单位(

供货单位编号char(10)notnull,

供货单位名称char(10)null,

供货单位地址char(15)null,

供货单位电话char(11)null,

constraintPK_供货单位primarykeynonclustered(供货单位编号)

go

/*==============================================================*/

/*Table:

借阅*/

/*==============================================================*/

createtable借阅(

借书证号char(10)notnull,

图书编号char(10)notnull,

借出日期datetimenull,

constraintPK_借阅primarykeynonclustered(借书证号,图书编号)

go

/*==============================================================*/

/*Table:

借阅者*/

/*==============================================================*/

createtable借阅者(

借书证号char(10)notnull,

读者班级char(8)null,

读者性别char

(2)notnull,

办证日期char(10)null,

图书数量intnull,

读者姓名varchar(8)notnull,

constraintPK_借阅者primarykeynonclustered(借书证号)

go

/*==============================================================*/

/*Table:

图书*/

/*==============================================================*/

createtable图书(

图书编号char(10)notnull,

作者varchar(8)null,

书名char(10)null,

借出日期datetimenull,

出版社char(15)null,

库存数intnull,

价格intnull,

constraintPK_图书primarykeynonclustered(图书编号)

go

/*==============================================================*/

/*Table:

图书管理*/

/*==============================================================*/

createtable图书管理(

图书管理编号char(10)notnull,

图书编号char(10)notnull,

constraintPK_图书管理primarykeynonclustered(图书管理编号,图书编号)

go

/*==============================================================*/

/*Table:

图书管理员*/

/*==============================================================*/

createtable图书管理员(

图书管理编号char(10)notnull,

图书管理姓名varchar(8)notnull,

图书管理性别char

(2)notnull,

constraintPK_图书管理员primarykeynonclustered(图书管理编号)

go

/*==============================================================*/

/*Table:

存入*/

/*==============================================================*/

createtable存入(

仓库编号char(10)notnull,

图书编号char(10)notnull,

constraintPK_存入primarykeynonclustered(仓库编号,图书编号)

go

/*==============================================================*/

/*Table:

归还*/

/*==============================================================*/

createtable归还(

借书证号char(10)notnull,

图书管理编号char(10)notnull,

归还日期datetimenull,

图书编号char(10)null,

书名char(10)null,

constraintPK_归还primarykeynonclustered(借书证号,图书管理编号)

go

/*==============================================================*/

/*Table:

管理2*/

/*==============================================================*/

createtable管理2(

图书管理编号char(10)notnull,

系统管理编号char(10)notnull,

constraintPK_管理2primarykeynonclustered(图书管理编号,系统管理编号)

go

/*==============================================================*/

/*Table:

管理3*/

/*==============================================================*/

createtable管理3(

系统管理编号char(10)notnull,

人员编号char(10)notnull,

constraintPK_管理3primarykeynonclustered(系统管理编号,人员编号)

go

/*==============================================================*/

/*Table:

系统管理*/

/*==============================================================*/

createtable系统管理(

系统管理编号char(10)notnull,

系统管理性别char

(2)notnull,

系统管理姓名varchar(8)notnull,

constraintPK_系统管理primarykeynonclustered(系统管理编号)

go

/*==============================================================*/

/*Table:

读书评论*/

/*==============================================================*/

createtable读书评论(

借书证号char(10)notnull,

评论char(50)null,

图书管理编号char(10)notnull,

图书编号char(10)null,

constraintPK_读书评论primarykeynonclustered(借书证号,图书管理编号)

go

/*==============================================================*/

/*Table:

购销*/

/*==============================================================*/

createtable购销(

人员编号char(10)notnull,

供货单位编号char(10)notnull,

购销价格intnull,

constraintPK_购销primarykeynonclustered(人员编号,供货单位编号)

go

/*==============================================================*/

/*Table:

采购*/

/*==============================================================*/

createtable采购(

人员编号char(10)notnull,

仓库编号char(10)notnull,

图书编号char(10)notnull,

采购数量intnull,

constraintPK_采购primarykeynonclustered(人员编号,仓库编号)

go

/*==============================================================*/

/*Table:

采购人员*/

/*==============================================================*/

createtable采购人员(

人员编号char(10)notnull,

人员姓名varchar(8)null,

人员性别char

(2)notnull,

人员电话char(11)null,

constraintPK_采购人员primarykeynonclustered(人员编号)

go

/*==============================================================*/

/*Table:

预约*/

/*==============================================================*/

createtable预约(

借书证号char(10)notnull,

图书管理编号char(10)notnull,

图书编号char(10)null,

书名char(10)null,

constraintPK_预约primarykeynonclustered(借书证号,图书管理编号)

go

触发器

借书要求(书本没有库存,则无法进行借书操作)

useLibrarysystem

go

CREATETRIGGERtri_book

on图书

forupdate

as

declare@btotalint

select@btotal=库存数

frominserted

if(@btotal<=0)

begin

rollbacktransaction

print'借阅失败!

'

print'对不起,此书已经没有库存,无法进行本次借书操作!

'

end

go

借书要求(读者最多借阅量)

useLibrarysystem

go

CREATETRIGGERtri_bookreader

on借阅者

forinsert

as

declare@nochar(10),@numint

select@no=inserted.借书证号frominserted

begin

select@num=count(*)

from借阅者

where借书证号=@noand图书数量=@num

if(@num>5)

begin

rollbacktransaction

print'借阅失败!

'

print'对不起,你的借阅总量已经达到本,无法进行本次借书操作!

请归还部分书籍后,再进行下次借书操作!

'

end

end

 

存储过程

读者借阅图书存储过程

useLibrarysystem

go

createprocedureRBorrowBook

@novarchar(10),

@bnovarchar(10)

as

declare@bnamevarchar(50)

ifexists(

select*from借阅者,图书where借书证号=@noand图书编号=@bno)

begin

print'对不起,你已经借阅了同一本图书,故而无法进行此次借书操作,请核实!

'

end

else

begin

update图书set库存数=库存数-1

where图书编号=@bno

insert

into借阅(借书证号,图书编号,借出日期)

values(@no,@bno,getdate())

declare@rnamevarchar(8)

select@rname=读者姓名from借阅者where借书证号=@no

select@bname=书名from图书where图书编号=@bno

select'编号为'+@no+',姓名为'+@rname+'的读者,于'

+datename(year,GETDATE())+'年'+datename(month,GETDATE())

+'月'+datename(day,GETDATE())+'日'+datename(hour,GETDATE())

+'时'+datename(minute,GETDATE())+'分'+datename(second,GETDATE())

+'秒,成功地从图书馆借出《'+@bname+'》一书!

'

as读者借书成功信息

end

go

读者还书存储过程

useLibrarysystem

go

createprocedureReturnBook

@novarchar(10),@bnovarchar(10)

as

declare@bnamevarchar(50)

ifnotexists(select*from借阅where借书证号=@noand图书编号=@bno)

begin

print'对不起,你没有借阅此书,故而无法进行此次还书操作,请核实!

'

end

elsebegin

update图书set库存数=库存数+1

where图书编号=@bno

delete

from借阅

where借书证号=@noand图书编号=@bno

declare@rnamevarchar(8)

select@rname=读者姓名

from借阅者

where借书证号=@no

select@bname=书名

from图书

where图书编号=@bno

select'编号为'+@no+',姓名为'+@rname+'的读者,于'

+datename(year,GETDATE())+'年'+datename(month,GETDATE())+

'月'+datename(day,GETDATE())+'日'+datename(hour,GETDATE())+

'时'+datename(minute,GETDATE())+'分'+datename(second,GETDATE())+

'秒,成功地向图书馆归还《'+@bname+'》一书!

'

as读者还书成功信息

end

execReturnBook1234567890,1234567890

三,实验中遇到的困难

在做powerdesigner的过程中,写概念模型时会对实体与实体之间的联系分不清。

四、指导教师评语及成绩:

 

成绩:

指导教师签名:

陈辉

批阅日期:

2013年10月27日

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 高等教育 > 研究生入学考试

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

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