数据库系统基础教程第三章答案

上传人:pu****.1 文档编号:508413823 上传时间:2022-12-23 格式:DOC 页数:23 大小:333KB
返回 下载 相关 举报
数据库系统基础教程第三章答案_第1页
第1页 / 共23页
数据库系统基础教程第三章答案_第2页
第2页 / 共23页
数据库系统基础教程第三章答案_第3页
第3页 / 共23页
数据库系统基础教程第三章答案_第4页
第4页 / 共23页
数据库系统基础教程第三章答案_第5页
第5页 / 共23页
点击查看更多>>
资源描述

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

1、Exercise 3、1、1Answers for this exercise may vary because of different interpretations、Some possible FDs:Social Security number nameArea code stateStreet address, city, state zipcodePossible keys:Social Security number, street address, city, state, area code, phone numberNeed street address, city, st

2、ate to uniquely determine location、 A person could have multiple addresses、 The same is true for phones、 These days, a person could have a landline and a cellular phoneExercise 3、1、2Answers for this exercise may vary because of different interpretationsSome possible FDs:ID x-position, y-position, z-

3、positionID x-velocity, y-velocity, z-velocityx-position, y-position, z-position IDPossible keys:IDx-position, y-position, z-positionThe reason why the positions would be a key is no two molecules can occupy the same point、Exercise 3、1、3aThe superkeys are any subset that contains A1、 Thus, there are

4、2(n-1) such subsets, since each of the n-1 attributes A2 through An may independently be chosen in or out、Exercise 3、1、3bThe superkeys are any subset that contains A1 or A2、 There are 2(n-1) such subsets when considering A1 and the n-1 attributes A2 through An、 There are 2(n-2) such subsets when con

5、sidering A2 and the n-2 attributes A3 through An、 We do not count A1 in these subsets because they are already counted in the first group of subsets、 The total number of subsets is 2(n-1) + 2(n-2)、Exercise 3、1、3cThe superkeys are any subset that contains A1,A2 or A3,A4、 There are 2(n-2) such subsets

6、 when considering A1,A2 and the n-2 attributes A3 through An、 There are 2(n-2) 2(n-4) such subsets when considering A3,A4 and attributes A5 through An along with the individual attributes A1 and A2、 We get the 2(n-4) term because we have to discard the subsets that contain the key A1,A2 to avoid dou

7、ble counting、 The total number of subsets is 2(n-2) + 2(n-2) 2(n-4)、Exercise 3、1、3dThe superkeys are any subset that contains A1,A2 or A1,A3、 There are 2(n-2) such subsets when considering A1,A2 and the n-2 attributes A3 through An、 There are 2(n-3) such subsets when considering A1,A3 and the n-3 at

8、tributes A4 through An We do not count A2 in these subsets because they are already counted in the first group of subsets、 The total number of subsets is 2(n-2) + 2(n-3)、Exercise 3、2、1aWe could try inference rules to deduce new dependencies until we are satisfied we have them all、 A more systematic

9、way is to consider the closures of all 15 nonempty sets of attributes、 For the single attributes we have A+ = A, B+ = B, C+ = ACD, and D+ = AD、 Thus, the only new dependency we get with a single attribute on the left is CA、Now consider pairs of attributes: AB+ = ABCD, so we get new dependency ABD、 A

10、C+ = ACD, and ACD is nontrivial、 AD+ = AD, so nothing new、 BC+ = ABCD, so we get BCA, and BCD、 BD+ = ABCD, giving us BDA and BDC、 CD+ = ACD, giving CDA、For the triples of attributes, ACD+ = ACD, but the closures of the other sets are each ABCD、 Thus, we get new dependencies ABCD, ABDC, and BCDA、Sinc

11、e ABCD+ = ABCD, we get no new dependencies、The collection of 11 new dependencies mentioned above are: CA, ABD, ACD, BCA, BCD, BDA, BDC, CDA, ABCD, ABDC, and BCDA、 Exercise 3、2、1bFrom the analysis of closures above, we find that AB, BC, and BD are keys、 All other sets either do not have ABCD as the c

12、losure or contain one of these three sets、Exercise 3、2、1cThe superkeys are all those that contain one of those three keys、 That is, a superkey that is not a key must contain B and more than one of A, C, and D、 Thus, the (proper) superkeys are ABC, ABD, BCD, and ABCD、Exercise 3、2、2ai) For the single

13、attributes we have A+ = ABCD, B+ = BCD, C+ = C, and D+ = D、 Thus, the new dependencies are AC and AD、Now consider pairs of attributes: AB+ = ABCD, AC+ = ABCD, AD+ = ABCD, BC+ = BCD, BD+ = BCD, CD+ = CD、 Thus the new dependencies are ABC, ABD, ACB, ACD, ADB, ADC, BCD and BDC、For the triples of attrib

14、utes, BCD+ = BCD, but the closures of the other sets are each ABCD、 Thus, we get new dependencies ABCD, ABDC, and ACDB、Since ABCD+ = ABCD, we get no new dependencies、The collection of 13 new dependencies mentioned above are: AC, AD, ABC, ABD, ACB, ACD, ADB, ADC, BCD, BDC, ABCD, ABDC and ACDB、ii) For

15、 the single attributes we have A+ = A, B+ = B, C+ = C, and D+ = D、 Thus, there are no new dependencies、Now consider pairs of attributes: AB+ = ABCD, AC+ = AC, AD+ = ABCD, BC+ = ABCD, BD+ = BD, CD+ = ABCD、 Thus the new dependencies are ABD, ADC, BCA and CDB、For the triples of attributes, all the closures of the sets are each ABCD、 Thus, we get new dependencies ABCD, ABDC, ACDB and BCDA、Since ABCD+ = ABCD, we get no new dependencies、The collection of 8 new dependencies mentioned above are: ABD, ADC, BCA, CDB,

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

当前位置:首页 > 建筑/环境 > 施工组织

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