LOANS:
BOOKS:
1) 检索借了5本书以上的学生的借书证号、姓名、系名和借书数量。
(1) select borrower.借书证号,姓名,系名,count(图书登记号) from borrower,loans where borrower.借书证号=loans.借书证号
and borrower.借书证号 in (select 借书证号 from loans group by 借书证号 having count(图书登记号)>=5)
(2) select borrower.借书证号,姓名,系名,count(图书登记号) from borrower,loans where borrower.借书证号=loans.借书证号
group by loans.借书证号 having count(图书登记号)>=5
2) 检索借书和欧阳同学所借图书中任意一本相同的学生的姓名、系名、书名和借书日期。
(1) select 姓名,系名,书名,借书日期 from borrower,loans,books where borrower.借书证号=loans.借书证号 and loans.图书
登记号=books.图书登记号 and 图书登记号 =any (select 图书登记号 from borrower,loans,books where borrower.借书证号=loans.借书证号 and loans.图书登记号=books.图书登记号 and 姓名=’欧阳’)
3) 建立信息系学生借书的视图SB,该视图的属性列由借书证号、姓名、班级、图书登记号、书名、出版社和借书日期组成。
(1) create view sb as select borrower.借书证号,姓名,班级,loans.图书登记号,书名,出版社,借书日期 from
borrower,loans,books where borrower.借书证号=loans.借书证号 and loans.图书登记号=books.图书登记号 and 系名=‘信息系’
第4章 关系数据库的查询优化 第5章关系数据库设计理论
八、要点
1. 不好的数据库一般存在的问题 2. 与函数依赖相关的概念 1) 函数依赖
2) 平凡函数依赖 3) 非平凡函数依赖 4) 完全函数依赖 5) 部分函数依赖 6) 传递函数依赖 7) 属性闭包的计算
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库数据库系统原理复习资料20120503(5)在线全文阅读。
相关推荐: