圖書館管理系統(tǒng)powerdesigner_第1頁
圖書館管理系統(tǒng)powerdesigner_第2頁
圖書館管理系統(tǒng)powerdesigner_第3頁
圖書館管理系統(tǒng)powerdesigner_第4頁
圖書館管理系統(tǒng)powerdesigner_第5頁
已閱讀5頁,還剩7頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1、本科學生設計性實驗報告數據庫課程設計學 院: 軟通學院 課程名稱: 數據庫課程設計 專業(yè)班級: 姓 名: 學 號: 開課學期 2021 至 2021 學年 第二 學期學生實驗報告一學生 學號同組人:實驗工程圖書館系統(tǒng)Ö必修選修 演示性實驗 驗證性實驗 Ö操作性實驗 綜合性實驗實驗地點 實驗儀器臺號指導教師陳輝實驗日期及節(jié)次一、實驗綜述 一、實驗任務1) 以圖書信息管理系統(tǒng)為例,開展數據庫系統(tǒng)設計 2) 使用Java語言開發(fā)相關系統(tǒng)界面,實現系統(tǒng)相關功能 3) 完成系統(tǒng)測試二、實驗要求系統(tǒng)功能要求1) 人員管理:讀者、圖書管理員、系統(tǒng)管理員,管理的內容包括

2、人員增、刪、查、改; 2) 書籍管理:采購、入庫、預約、借閱、續(xù)借、歸還、查詢、統(tǒng)計、讀書評論。 3) 倉庫管理:管理圖書館藏信息 4) 供給商管理:管理圖書供給商 5) 財務管理:管理圖書采購帳目三、實驗儀器、設備或軟件儀器設備:電腦一臺數據庫系統(tǒng)設計:PowerdesignerJava開發(fā)工具: JDK1.6或以上 Eclipse 或者NetBeans系統(tǒng)測試:人工測試二、實驗過程(編程,調試,運行;請寫上源碼,要求要有注釋)1.1.ER圖2.邏輯結構3.物理結構代碼局部建表命令/*=*/* Table: 倉庫 */*=

3、*/create table 倉庫 ( 倉庫編號 char(10) not null, 圖書數量 int null, constraint PK_倉庫 primary key nonclustered (倉庫編號)go/*=*/* Table: 供貨單位 */*=*/create table 供貨單位 ( 供貨單位編號 char(10) not null, 供貨單位名稱 char(10) null, 供貨單位地址 char(15) null, 供貨單位 char(11) null, constraint PK_供貨單位 primary key nonclustered (供貨單位編號)go/*

4、=*/* Table: 借閱 */*=*/create table 借閱 ( 借書證號 char(10) not null, 圖書編號 char(10) not null, 借出日期 datetime null, constraint PK_借閱 primary key nonclustered (借書證號, 圖書編號)go/*=*/* Table: 借閱者 */*=*/create table 借閱者 ( 借書證號 char(10) not null, 讀者班級 char(8) null, 讀者性別 char(2) not null, 辦證日期 char(10) null, 圖書數量 int

5、 null, 讀者 varchar(8) not null, constraint PK_借閱者 primary key nonclustered (借書證號)go/*=*/* Table: 圖書 */*=*/create table 圖書 ( 圖書編號 char(10) not null, 作者 varchar(8) null, 書名 char(10) null, 借出日期 datetime null, 出版社 char(15) null, 庫存數 int null, 價格 int null, constraint PK_圖書 primary key nonclustered (圖書編號)g

6、o/*=*/* Table: 圖書管理 */*=*/create table 圖書管理 ( 圖書管理編號 char(10) not null, 圖書編號 char(10) not null, constraint PK_圖書管理 primary key nonclustered (圖書管理編號, 圖書編號)go/*=*/* Table: 圖書管理員 */*=*/create table 圖書管理員 ( 圖書管理編號 char(10) not null, 圖書管理 varchar(8) not null, 圖書管理性別 char(2) not null, constraint PK_圖書管理員

7、primary key nonclustered (圖書管理編號)go/*=*/* Table: 存入 */*=*/create table 存入 ( 倉庫編號 char(10) not null, 圖書編號 char(10) not null, constraint PK_存入 primary key nonclustered (倉庫編號, 圖書編號)go/*=*/* Table: 歸還 */*=*/create table 歸還 ( 借書證號 char(10) not null, 圖書管理編號 char(10) not null, 歸還日期 datetime null, 圖書編號 char

8、(10) null, 書名 char(10) null, constraint PK_歸還 primary key nonclustered (借書證號, 圖書管理編號)go/*=*/* Table: 管理2 */*=*/create table 管理2 ( 圖書管理編號 char(10) not null, 系統(tǒng)管理編號 char(10) not null, constraint PK_管理2 primary key nonclustered (圖書管理編號, 系統(tǒng)管理編號)go/*=*/* Table: 管理3 */*=*/create table 管理3 ( 系統(tǒng)管理編號 char(10

9、) not null, 人員編號 char(10) not null, constraint PK_管理3 primary key nonclustered (系統(tǒng)管理編號, 人員編號)go/*=*/* Table: 系統(tǒng)管理 */*=*/create table 系統(tǒng)管理 ( 系統(tǒng)管理編號 char(10) not null, 系統(tǒng)管理性別 char(2) not null, 系統(tǒng)管理 varchar(8) not null, constraint PK_系統(tǒng)管理 primary key nonclustered (系統(tǒng)管理編號)go/*=*/* Table: 讀書評論 */*=*/crea

10、te table 讀書評論 ( 借書證號 char(10) not null, 評論 char(50) null, 圖書管理編號 char(10) not null, 圖書編號 char(10) null, constraint PK_讀書評論 primary key nonclustered (借書證號, 圖書管理編號)go/*=*/* Table: 購銷 */*=*/create table 購銷 ( 人員編號 char(10) not null, 供貨單位編號 char(10) not null, 購銷價格 int null, constraint PK_購銷 primary key n

11、onclustered (人員編號, 供貨單位編號)go/*=*/* Table: 采購 */*=*/create table 采購 ( 人員編號 char(10) not null, 倉庫編號 char(10) not null, 圖書編號 char(10) not null, 采購數量 int null, constraint PK_采購 primary key nonclustered (人員編號, 倉庫編號)go/*=*/* Table: 采購人員 */*=*/create table 采購人員 ( 人員編號 char(10) not null, 人員 varchar(8) null,

12、 人員性別 char(2) not null, 人員 char(11) null, constraint PK_采購人員 primary key nonclustered (人員編號)go/*=*/* Table: 預約 */*=*/create table 預約 ( 借書證號 char(10) not null, 圖書管理編號 char(10) not null, 圖書編號 char(10) null, 書名 char(10) null, constraint PK_預約 primary key nonclustered (借書證號, 圖書管理編號)go觸發(fā)器借書要求書本沒有庫存,那么無法進

13、行借書操作use Librarysystem goCREATE TRIGGER tri_bookon 圖書for updateas declare btotal intselect btotal=庫存數from inserted if(btotal<=0) begin rollback transaction print '借閱失?。?#39; print'對不起,此書已經沒有庫存,無法進行本次借書操作!' end go借書要求讀者最多借閱量use Librarysystem goCREATE TRIGGER tri_bookreaderon 借閱者for ins

14、ert as declare no char(10),num intselect no=inserted.借書證號 from insertedbegin select num=count(*) from 借閱者 where 借書證號=no and 圖書數量=numif(num>5) begin rollback transaction print '借閱失??!' print'對不起,你的借閱總量已經到達本,無法進行本次借書操作!請歸還局部書籍后,再進行下次借書操作!' end end存儲過程讀者借閱圖書存儲過程use Librarysystem gocre

15、ate procedure RBorrowBook no varchar(10) ,bno varchar(10) asdeclare bname varchar(50) if exists(select * from 借閱者,圖書 where 借書證號=no and 圖書編號=bno) begin print'對不起,你已經借閱了同一本圖書,故而無法進行此次借書操作,請核實!' end else begin update 圖書 set 庫存數=庫存數-1 where 圖書編號=bnoinsert into 借閱 (借書證號,圖書編號,借出日期) values (no,bno,

16、getdate() declare rname varchar(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,GET

17、DATE()+' 時'+datename(minute,GETDATE()+' 分'+datename(second,GETDATE()+' 秒,成功地從圖書館借出?'+bname+'?一書!' as 讀者借書成功信息 end go讀者還書存儲過程use Librarysystem go create procedure ReturnBook no varchar(10),bno varchar(10) as declare bname varchar(50) if not exists(select * from 借閱 wher

18、e 借書證號=no and 圖書編號=bno) begin print'對不起,你沒有借閱此書,故而無法進行此次還書操作,請核實!' end else begin update 圖書 set 庫存數=庫存數+1 where 圖書編號=bnodelete from 借閱 where 借書證號=no and 圖書編號=bno declare rname varchar(8) select rname=讀者 from 借閱者 where 借書證號=no select bname=書名from 圖書where 圖書編號=bno select '編號為'+no+',為'+rname+'的讀者,于'+datename(year,GETDATE()+' 年'+datename(month,GETDATE()+' 月'+datename(day,GETDATE()+' 日'+datename(h

溫馨提示

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

評論

0/150

提交評論