(完整版)数据库系统基础教程第五章答案.doc

上传人:m**** 文档编号:552692732 上传时间:2022-11-11 格式:DOC 页数:16 大小:218.51KB
返回 下载 相关 举报
(完整版)数据库系统基础教程第五章答案.doc_第1页
第1页 / 共16页
(完整版)数据库系统基础教程第五章答案.doc_第2页
第2页 / 共16页
(完整版)数据库系统基础教程第五章答案.doc_第3页
第3页 / 共16页
(完整版)数据库系统基础教程第五章答案.doc_第4页
第4页 / 共16页
(完整版)数据库系统基础教程第五章答案.doc_第5页
第5页 / 共16页
点击查看更多>>
资源描述

《(完整版)数据库系统基础教程第五章答案.doc》由会员分享,可在线阅读,更多相关《(完整版)数据库系统基础教程第五章答案.doc(16页珍藏版)》请在金锄头文库上搜索。

1、Exercise 5.1.1As a set:speed2.662.101.422.803.202.202.001.863.06Average = 2.37As a bag:speed2.662.101.422.803.203.202.202.202.002.801.862.803.06Average = 2.48Exercise 5.1.2As a set:hd25080320200300160Average = 218As a bag:hd2502508025025032020025025030016016080Average = 215Exercise 5.1.3aAs a set:bo

2、re15161418As a bag:bore1516141615151418Exercise 5.1.3bbore(Ships Classes)Exercise 5.1.4aFor bags:On the left-hand side:Given bags R and S where a tuple t appears n and m times respectively, the union of bags R and S will have tuple t appear n + m times. The further union of bag T with the tuple t ap

3、pearing o times will have tuple t appear n + m + o times in the final result. On the right-hand side:Given bags S and T where a tuple t appears m and o times respectively, the union of bags R and S will have tuple t appear m + o times. The further union of bag R with the tuple t appearing n times wi

4、ll have tuple t appear m + o + n times in the final result.For sets:This is a similar case when dealing with bags except the tuple t can only appear at most once in each set. The tuple t only appears in the result if all the sets have the tuple t. Otherwise, the tuple t will not appear in the result

5、. Since we cannot have duplicates, the result only has at most one copy of the tuple t.Exercise 5.1.4bFor bags:On the left-hand side:Given bags R and S where a tuple t appears n and m times respectively, the intersection of bags R and S will have tuple t appear min( n, m ) times. The further interse

6、ction of bag T with the tuple t appearing o times will produce tuple t min( o, min( n, m ) ) times in the final result. On the right-hand side:Given bags S and T where a tuple t appears m and o times respectively, the intersection of bags R and S will have tuple t appear min( m, o ) times. The furth

7、er intersection of bag R with the tuple t appearing n times will produce tuple t min( n, min( m, o ) ) times in the final result.The intersection of bags R,S and T will yield a result where tuple t appears min( n,m,o ) times.For sets:This is a similar case when dealing with bags except the tuple t c

8、an only appear at most once in each set. The tuple t only appears in the result if all the sets have the tuple t. Otherwise, the tuple t will not appear in the result.Exercise 5.1.4cFor bags:On the left-hand side:Given that tuple r in R, which appears m times, can successfully join with tuple s in S

9、, which appears n times, we expect the result to contain mn copies. Also given that tuple t in T, which appears o times, can successfully join with the joined tuples of r and s, we expect the final result to have mno copies.On the right-hand side:Given that tuple s in S, which appears n times, can s

10、uccessfully join with tuple t in T, which appears o times, we expect the result to contain no copies. Also given that tuple r in R, which appears m times, can successfully join with the joined tuples of s and t, we expect the final result to have nom copies.The order in which we perform the natural

11、join does not matter for bags.For sets:This is a similar case when dealing with bags except the joined tuples can only appear at most once in each result. If there are tuples r,s,t in relations R,S,T that can successfully join, then the result will contain a tuple with the schema of their joined att

12、ributes.Exercise 5.1.4dFor bags:Suppose a tuple t occurs n and m times in bags R and S respectively. In the union of these two bags R S, tuple t would appear n + m times. Likewise, in the union of these two bags S R, tuple t would appear m + n times. Both sides of the relation yield the same result.

13、 For sets:A tuple t can only appear at most one time. Tuple t might appear each in sets R and S one or zero times. The combinations of number of occurrences for tuple t in R and S respectively are (0,0), (0,1), (1,0), and (1,1). Only when tuple t appears in both sets R and S will the union R S have

14、the tuple t. The same reasoning holds when we take the union S R. Therefore the commutative law for union holds.Exercise 5.1.4eFor bags:Suppose a tuple t occurs n and m times in bags R and S respectively. In the intersection of these two bags R S, tuple t would appear min( n,m ) times. Likewise in t

15、he intersection of these two bags S R, tuple t would appear min( m,n ) times. Both sides of the relation yield the same result. For sets:A tuple t can only appear at most one time. Tuple t might appear each in sets R and S one or zero times. The combinations of number of occurrences for tuple t in R and S respectively are (0,0), (0,1), (1,0), and (1,1). Only when tuple t appears in at least one of the sets R and S will the intersection R S have the tuple t. The s

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 大杂烩/其它

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号