




已阅读5页,还剩3页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
图书馆管理系统建模设计由PDM对象自动生成的数据库脚本文件代码如下:7if 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 = FK_BOOKS_管理书籍_ADMIN)alter table books drop constraint FK_BOOKS_管理书籍_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(borrow_information) and = 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.id = r.constid and o.type = F) where r.fkeyid = object_id(borrow_information) and = 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) where r.fkeyid = object_id(login) and = 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 = FK_LOGIN_LOGIN2_READER)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 = FK_REVERSAT_REVERSATI_BOOKS)alter table reversation drop constraint FK_REVERSAT_REVERSATI_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 = FK_REVERSAT_REVERSATI_READER)alter table reversation drop constraint FK_REVERSAT_REVERSATI_READERgoif exists (select 1 from sysindexes 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 type = 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 ( 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_id), 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 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_id 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_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_LOGIN 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 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) refer
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年致远学院第一批次人才引进考前自测高频考点模拟试题及1套参考答案详解
- 2025合同样本:购房定金合同示范文本
- 2025江苏宿迁市泗洪县卫健系统引进高层次人才33名模拟试卷及答案详解(全优)
- 2025广东广州市百万英才汇南粤广州中医药大学第三附属医院招聘14人模拟试卷带答案详解
- 广西柳州市2026届高三上学期9月月考试题 物理 含答案
- 2025湖北恩施州宣恩县园投人力资源服务有限公司招聘多家企业人员人员考前自测高频考点模拟试题及答案详解(全优)
- 火力电厂考试题库及答案
- 电商直播考试题库及答案
- 海油电焊考试题库及答案
- 咖啡大师考试题库及答案
- 《中央管理企业负责人薪酬制度改革方案》
- 火锅店厨房管理制度
- 个人贷款管理办法(2024年第3号)
- 教科版六年级上册科学2.2《昼夜交替现象》(课件)
- 小学语文课程与教第二章:小学语文课程教材
- 苏教版一年级上册科学素材期末复习知识点总结
- 片石购买合同样本
- 学前教育普及普惠督导评估内容和标准量化评分表
- 办公楼物业服务技术方案
- 小学教学常规管理制度汇编
- 北师大版数学六年级上册第一单元 《圆》 大单元作业设计
评论
0/150
提交评论