收藏 分销(赏)

图书馆管理系统建模设计.doc

上传人:精*** 文档编号:3609877 上传时间:2024-07-10 格式:DOC 页数:10 大小:44.04KB
下载 相关 举报
图书馆管理系统建模设计.doc_第1页
第1页 / 共10页
图书馆管理系统建模设计.doc_第2页
第2页 / 共10页
图书馆管理系统建模设计.doc_第3页
第3页 / 共10页
图书馆管理系统建模设计.doc_第4页
第4页 / 共10页
图书馆管理系统建模设计.doc_第5页
第5页 / 共10页
点击查看更多>>
资源描述

1、图书馆管理系统建模设计由PDM对象自动生成旳数据库脚本文献代码如下:if exists (select 1 from dbo.sysreferences r join dbo.sysobjects o on (o.id = r.constid and o.type = F) where r.fkeyid = object_id(books) and o.name = FK_BOOKS_管理书籍_ADMIN)alter table books drop constraint FK_BOOKS_管理书籍_ADMINgoif exists (select 1 from dbo.sysreferenc

2、es r join dbo.sysobjects o on (o.id = r.constid and o.type = F) where r.fkeyid = object_id(borrow_information) and o.name = FK_BORROW_I_BORROW_IN_BOOKS)alter table borrow_information drop constraint FK_BORROW_I_BORROW_IN_BOOKSgoif exists (select 1 from dbo.sysreferences r join dbo.sysobjects o on (o

3、.id = r.constid and o.type = F) where r.fkeyid = object_id(borrow_information) and o.name = FK_BORROW_I_BORROW_IN_READER)alter table borrow_information drop constraint FK_BORROW_I_BORROW_IN_READERgoif exists (select 1 from dbo.sysreferences r join dbo.sysobjects o on (o.id = r.constid and o.type = F

4、) where r.fkeyid = object_id(login) and o.name = FK_LOGIN_LOGIN_ADMIN)alter table login drop constraint FK_LOGIN_LOGIN_ADMINgoif exists (select 1 from dbo.sysreferences r join dbo.sysobjects o on (o.id = r.constid and o.type = F) where r.fkeyid = object_id(login) and o.name = FK_LOGIN_LOGIN2_READER)

5、alter table login drop constraint FK_LOGIN_LOGIN2_READERgoif exists (select 1 from dbo.sysreferences r join dbo.sysobjects o on (o.id = r.constid and o.type = F) where r.fkeyid = object_id(reversation) and o.name = FK_REVERSAT_REVERSATI_BOOKS)alter table reversation drop constraint FK_REVERSAT_REVER

6、SATI_BOOKSgoif exists (select 1 from dbo.sysreferences r join dbo.sysobjects o on (o.id = r.constid and o.type = F) where r.fkeyid = object_id(reversation) and o.name = FK_REVERSAT_REVERSATI_READER)alter table reversation drop constraint FK_REVERSAT_REVERSATI_READERgoif exists (select 1 from sysinde

7、xes where id = object_id(admin) and name = 权限_FK and indid 0 and indid 0 and indid 0 and indid 0 and indid 0 and indid 0 and indid 0 and indid 0 and indid 0 and indid 0 and indid 255) drop index reversation.reversation_FKgoif exists (select 1 from sysobjects where id = object_id(reversation) and typ

8、e = U) drop table reversationgocreate table admin ( admin_id int not null, admin_name char(20) null, admin_password char(16) null, logins int null, last_login char(10) null, right int null, constraint PK_ADMIN primary key nonclustered (admin_id)gocreate index 权限_FK on admin ()gocreate table booktype

9、 ( type_id int null)gocreate table books ( book_id int not null, admin_id int null, title char(20) null, type_id int null, author char(40) null, price money null, book concern char(50) null, addtime datetime null, amount int null, remain int null, constraint PK_BOOKS primary key nonclustered (book_i

10、d), constraint FK_BOOKS_管理书籍_ADMIN foreign key (admin_id) references admin (admin_id), constraint FK_BOOKS_BOOKTYPE_BOOKTYPE foreign key () references booktype)gocreate index 图书类型_FK on books ()gocreate index 管理书籍_FK on books (admin_id ASC)go create table reader ( reader_id int not null, reader_name

11、 char(20) null, sex char(2) null, age tinyint null, class char(15) null, address text null, memo text null, maxborrowed int null, reader_password char(16) null, right int null, constraint PK_READER primary key nonclustered (reader_id)gocreate table borrow_information ( book_id int not null, reader_i

12、d int not null, borrow_time datetime null, end_time datetime null, amount int null, return_time datetime null, constraint PK_BORROW_INFORMATION primary key (book_id, reader_id), constraint FK_BORROW_I_BORROW_IN_BOOKS foreign key (book_id) references books (book_id), constraint FK_BORROW_I_BORROW_IN_

13、READER foreign key (reader_id) references reader (reader_id)gocreate index Association_1_FK on borrow_information (book_id ASC)gocreate index Association_2_FK on borrow_information (reader_id ASC)gocreate table login ( admin_id int not null, reader_id int not null, right int null, constraint PK_LOGI

14、N primary key (admin_id, reader_id), constraint FK_LOGIN_LOGIN_ADMIN foreign key (admin_id) references admin (admin_id), constraint FK_LOGIN_LOGIN2_READER foreign key (reader_id) references reader (reader_id)gocreate index login_FK on login (admin_id ASC)gocreate index login2_FK on login (reader_id

15、ASC)gocreate index 顾客权限_FK on reader ()gocreate table reversation ( book_id int not null, reader_id int not null, reservation_time datetime null, reservationcancel datetime null, constraint PK_REVERSATION primary key (book_id, reader_id), constraint FK_REVERSAT_REVERSATI_BOOKS foreign key (book_id) references books (book_id), constraint FK_REVERSAT_REVERSATI_READER foreign key (reader_id) references reader (reader_id)gocreate index reversation_FK on reversation (book_id ASC)gocreate index reversation2_FK on reversation (reader_id ASC)go

展开阅读全文
部分上传会员的收益排行 01、路***(¥15400+),02、曲****(¥15300+),
03、wei****016(¥13200+),04、大***流(¥12600+),
05、Fis****915(¥4200+),06、h****i(¥4100+),
07、Q**(¥3400+),08、自******点(¥2400+),
09、h*****x(¥1400+),10、c****e(¥1100+),
11、be*****ha(¥800+),12、13********8(¥800+)。
相似文档                                   自信AI助手自信AI助手
搜索标签

当前位置:首页 > 包罗万象 > 大杂烩

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        获赠5币

©2010-2024 宁波自信网络信息技术有限公司  版权所有

客服电话:4008-655-100  投诉/维权电话:4009-655-100

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :gzh.png    weibo.png    LOFTER.png 

客服