ImageVerifierCode 换一换
格式:PDF , 页数:9 ,大小:711.18KB ,
资源ID:10401221      下载积分:10 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.docduoduo.com/d-10401221.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录   微博登录 

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(数据库复习题及答案.pdf)为本站会员(精品资料)主动上传,道客多多仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知道客多多(发送邮件至docduoduo@163.com或直接QQ联系客服),我们立即给予删除!

数据库复习题及答案.pdf

1、 II. III. The key fields are underlined, and the domain of each field is listed after the field name. Therefore sid is the key for Suppliers, pid is the key for Parts, and sid and pid together form the key for Catalog. The Catalog relation lists the prices charged for parts by Suppliers. Write the f

2、ollowing queries in relational algebra. 1. Find the names of suppliers who supply some red part. 2. Find the sids of suppliers who supply some red or green part. 3. Find the sids of suppliers who supply some red part or are at 221 Packer Street. 4. Find the sids of suppliers who supply some red part

3、 and some green part. 5. Find the sids of suppliers who supply every part. 6. Find the sids of suppliers who supply every red part. 7. Find the sids of suppliers who supply every red or green part. 8. Find the sids of suppliers who supply every red part or supply every green part. 9. Find pairs of s

4、ids such that the supplier with the first sid charges more for some part than the supplier with the second sid. 10. Find the pids of parts supplied by at least two different suppliers. 11. Find the pids of the most expensive parts supplied by suppliers named Yosemite Sham. 12. Find the pids of parts

5、 supplied by every supplier at less than $200. (If any supplier either does not supply the part or charges more than $200 for it, the part is not selected.) IV Consider the following schema: Suppliers(sid: integer, sname: string, address: string) Parts(pid: integer, pname: string, color: string) Cat

6、alog(sid: integer, pid: integer, cost: real) The Catalog relation lists the prices charged for parts by Suppliers. Write the following queries in SQL: 1. Find the pnames of parts for which there is some supplier. 2. Find the snames of suppliers who supply every part. 3. Find the snames of suppliers

7、who supply every red part. 4. Find the pnames of parts supplied by Acme Widget Suppliers and no one else. 5. Find the sids of suppliers who charge more for some part than the average cost of that part (averaged over all the suppliers who supply that part). 6. For each part, find the sname of the sup

8、plier who charges the most for that part. 7. Find the sids of suppliers who supply only red parts. 8. Find the sids of suppliers who supply a red part and a green part. 9. Find the sids of suppliers who supply a red part or a green part. 10. For every supplier that only supplies green parts, print t

9、he name of the supplier and the total number of parts that she supplies. 11. For every supplier that supplies a green part and a red part, print the name and price of the most expensive part that she supplies. V. Consider the B+ tree index of order d = 2 shown in the following figure. 1. Show the tr

10、ee that would result from inserting a data entry with key 9 into this tree. 2. Show the B+ tree that would result from inserting a data entry with key 3 into the original tree. How many page reads and page writes does the insertion require? 3. Show the B+ tree that would result from deleting the dat

11、a entry with key 8 from the original tree, assuming that the left sibling is checked for possible redistribution. 4. Show the B+ tree that would result from deleting the data entry with key 8 from the original tree, assuming that the right sibling is checked for possible redistribution. 5. Show the

12、B+ tree that would result from starting with the original tree, inserting a data entry with key 46 and then deleting the data entry with key 52. 6. Show the B+ tree that would result from deleting the data entry with key 91 from the original tree. 7. Show the B+ tree that would result from starting

13、with the original tree, inserting a data entry with key 59, and then deleting the data entry with key 91. 8. Show the B+ tree that would result from successively deleting the data entries with keys 32, 39, 41, 45, and 73 from the original tree. Answer 10.1 1. The data entry with key 9 is inserted on

14、 the second leaf page. The resulting tree is shown in figure 10.2. 2. The data entry with key 3 goes on the first leaf page F. Since F can accommodate at most four data entries (d = 2), F splits. The lowest data entry of the new leaf is given up to the ancestor which also splits. The result can be s

15、een in figure 10.3. The insertion will require 5 page writes, 4 page reads and allocation of 2 new pages. 3. The data entry with key 8 is deleted, resulting in a leaf page N with less than two data entries. The left sibling L is checked for redistribution. Since L has more than two data entries, the

16、 remaining keys are redistributed between L and N, resulting in the tree in figure 10.4. 4. As is part 3, the data entry with key 8 is deleted from the leaf page N. Ns right sibling R is checked for redistribution, but R has the minimum number of keys. Therefore the two siblings merge. The key in th

17、e ancestor which distinguished between the newly merged leaves is deleted. The resulting tree is shown in figure 10.5. 5. The data entry with key 46 can be inserted without any structural changes in the tree. But the removal of the data entry with key 52 causes its leaf page L to merge with a siblin

18、g (we chose the right sibling). This results in the removal of a key in the ancestor A of L and thereby lowering the number of keys on A below the minimum number of keys. Since the left sibling B of A has more than the minimum number of keys, redistribution between A and B takes place. The final tre

19、e is depicted in figure 10.6. 6. Deleting the data entry with key 91 causes a scenario similar to part 5. The result can be seen in figure 10.7. 7. The data entry with key 59 can be inserted without any structural changes in the tree. No sibling of the leaf page with the data entry with key 91 is af

20、fected by the insert. Therefore deleting the data entry with key 91 changes the tree in a way very similar to part 6. The result is depicted in figure 10.8. 8. Considering checking the right sibling for possible merging first, the successivedeletion of the data entries with keys 32, 39, 41, 45 and 73 results in the tree shown in figure 10.9.

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:道客多多官方知乎号:道客多多

经营许可证编号: 粤ICP备2021046453号世界地图

道客多多©版权所有2020-2025营业执照举报