freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

數(shù)據(jù)庫課程設(shè)計——圖書管理系統(tǒng)(編輯修改稿)

2025-05-04 23:10 本頁面
 

【文章內(nèi)容簡介】 readers_table(借書證號 int primary key,姓名 varchar(10) not null,性別 char(2) default39。男39。,讀者類別 varchar(20) null,注冊日期 Datetime not null) 創(chuàng)建books_table表Create table books_table(書籍編號 varchar(20) primary key,書籍名稱 varchar(30) not null,作者 char(30) not null,出版社 varchar(30) null,出版日期 Datetime null,單價 Money not null,借閱情況 varchar(20) not null) 創(chuàng)建borrow_record_table表create table borrow_record_table(姓名 varchar(10) not null,書籍編號 varchar(20) not null,書籍名稱 varchar(30) not null,借書證號 int not null,借閱時間 Datetime not null,應(yīng)還時間 Datetime not null,foreign key(書籍編號) references books_table(書籍編號),foreign key(借書證號) references readers_table(借書證號)) 創(chuàng)建return_record_table表Create table return_record_table(姓名 varchar(10) not null書籍編號 varchar(20) not null,書籍名稱 varchar(30) not null借書證號 int not null,借閱時間 Datetime not null,foreign key(書籍編號) references books_table(書籍編號),foreign key(借書證號) references readers_table(借書證號)) 創(chuàng)建reader_fee_table表Create table reader_fee_table(書籍編號 varchar(20) not null,借書證號 int not null,姓名 varchar(10) not null,書籍名稱 varchar(30) not null,超期時間 int not null,罰款金額 Money not null,foreign key(書籍編號) references books_table(書籍編號),foreign key(借書證號) references readers_table(借書證號)) 創(chuàng)建視圖 用于查詢圖書基本信息的視圖定義如下: create view Bookview (借閱證號, 書籍編號, 作者, 出版社, 借閱情況)asSelect 借閱證號, 書籍編號, 作者, 出版社, 借閱情況from books_table 用于讀者基本信息查詢的視圖定義如下:create view Readerview (姓名,j借書證號,注冊日期)asselect 姓名,借書證號,注冊日期from readers_table 用于顯示當(dāng)前借閱基本信息的視圖定義如下:create view Borrowview (借書證號,書籍名稱,作者,借閱日期,應(yīng)還日期)asselect , ,作者,借閱日期,應(yīng)還日期from borrow_record_table,books_tablewhere =books_table. 書籍編號 :create view Historyview (借書證號,書籍名稱,借閱日期,歸還日期)asselect 借書證號,書籍名稱,借閱日期,歸還日期from return_record_table :create view Fineview (姓名,書籍名稱,超期時間,罰款金額)asselect 姓名,書籍名稱,超期時間,罰款金額from reader_fee_table 創(chuàng)建索引create unique index readersindex on readers_table(借書證號)create unique index booksindex on books_table(書籍編號)create unique index index1 on borrow_record_table(借書證號,書籍編號)create unique index index2 on return_record_table(借書證號,書籍編號) 創(chuàng)建觸發(fā)器 當(dāng)刪除readers_table表中某一讀者基本信息時,觸發(fā)borrow_record_table表,刪除相應(yīng)的記錄create trigger Reader_deleteon readers_tablefor deleteas declare @zhao int。select @zhao=借書證號from deleteddelete borrow_record_tablewhere 借書證號=@zhao,使該圖書的狀態(tài)由“可借”變?yōu)椤安豢山琛眂reate trigger Borrow_insert1on borrow_record_tablefor insertas declare @BookID char(20)。select @BookID=書籍編號from insertedupdate books_tableset 借閱情況=39。不可借39。where 書籍編號=@BookID 數(shù)據(jù)表的初始化 books_stytle_table表的初始化Insert into books_stytle_table values(1,39。人文藝術(shù)類39。)Insert into books_stytle_table values(2,39。自然科學(xué)類39。)Insert into books_stytle_table values(3,39。工程技術(shù)類39。)insert into books_stytle_table valu
點擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1