已阅读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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2022年黑龙江省哈尔滨市平房区重点达标名校毕业升学考试模拟卷化学卷含解析
- 外研版(2019)必修第三册Unit 1 Knowing me knowing you Using language 导学案
- 福建省龙岩八中学2024届中考联考英语试题含答案
- 2022届江西省鄱阳县第二中学中考化学考前最后一卷含解析
- 机电安装工程施工组织设计
- 校园安全隐患排查记录表(每学期)
- 福建省福州市台江区重点名校2022年中考试题猜想化学试卷含解析
- 浙江省金华市义乌市2022年中考化学模拟预测题含解析
- 河南省平顶山市汝州市实验中学2024届高考数学倒计时模拟卷含解析
- 2024年市场调查服务项目调研分析报告
- 银行普法知识培训课件
- 南京求真中学英语新初一分班试卷含答案
- 六年级下册英语课件Project2-A-travel-book(第1课时)-译林版
- 腾讯招聘测评题库答案大全
- 2024年多方通信服务相关项目评价分析报告
- 水文站项目建议书
- 《2023-CSCO食管癌诊疗指南》解读课件
- 《讲好中国故事》作文
- 《白酒团购营销方案》课件
- 机电题库2024(矿安益考试平台题库)
- 【精品】文物藏品档案规范(WWT00202008)98.doc
评论
0/150
提交评论