数据库系统基础教程第三章答案.pdf
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_05.gif)
《数据库系统基础教程第三章答案.pdf》由会员分享,可在线阅读,更多相关《数据库系统基础教程第三章答案.pdf(32页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、数数据据库库系系统统基基础础教教程程第第三三章章答答案案-CAL-FENGHAI.-(YICAI)-Company One1Exercise 3.1.1Exercise 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 a
2、ddress,city,state,area code,phone numberNeed street address,city,state to uniquely determine location.A person could have multipleaddresses.The same is true for phones.These days,a person could have a landline and a cellularphoneExercise 3.1.2Exercise 3.1.2Answers for this exercise may vary because
3、of different interpretationsSome possible FDs:ID x-position,y-position,z-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.
4、1.3aExercise 3.1.3aThe superkeys are any subset that contains A1.Thus,there are 2(n-1)such subsets,since each of the n-1attributes A2 through An may independently be chosen in or out.Exercise 3.1.3bExercise 3.1.3b(n-1)The superkeys are any subset that contains A1 or A2.There are 2 such subsets when(
5、n-2)considering A1 and the n-1 attributes A2 through An.There are 2 such subsets whenconsidering A2 and the n-2 attributes A3 through An.We do not count A1 in these subsetsbecause they are already counted in the first group of subsets.The total number of(n-1)(n-2)subsets is 2+2.Exercise 3.1.3cExerci
6、se 3.1.3c2The superkeys are any subset that contains A1,A2 or A3,A4.There are 2 such subsets(n-2)(n-4)when considering A1,A2 and the n-2 attributes A3 through An.There are 2 2 suchsubsets when considering A3,A4 and attributes A5 through An along with the individual(n-4)attributes A1 and A2.We get th
7、e 2 term because we have to discard the subsets that(n-2)contain the key A1,A2 to avoid double counting.The total number of subsets is 2+(n-2)(n-4)2 2.Exercise 3.1.3dExercise 3.1.3d(n-2)The superkeys are any subset that contains A1,A2 or A1,A3.There are 2 such subsets(n-3)when considering A1,A2 and
8、the n-2 attributes A3 through An.There are 2 such subsetswhen considering A1,A3 and the n-3 attributes A4 through An We do not count A2 in thesesubsets because they are already counted in the first group of subsets.The total number(n-2)(n-3)of subsets is 2+2.Exercise 3.2.1aExercise 3.2.1aWe could tr
9、y inference rules to deduce new dependencies until we are satisfied we havethem all.A more systematic way is to consider the closures of all 15 nonempty sets ofattributes.+For the single attributes we have A=A,B =B,C =ACD,and D =AD.Thus,theonly new dependency we get with a single attribute on the le
10、ft is CA.Now consider pairs of attributes:+AB =ABCD,so we get new dependency ABD.AC =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 eachABCD.
11、Thus,we get new dependencies ABCD,ABDC,and BCDA.+Since 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.1bExercise 3.2.1bFrom the analysis of closures above,we find that AB,BC,and BD are key
12、s.All other setseither do not have ABCD as the closure or contain one of these three sets.Exercise 3.2.1cExercise 3.2.1cThe superkeys are all those that contain one of those three keys.That is,a superkeythat is not a key must contain B and more than one of A,C,and D.Thus,the(proper)superkeys are ABC
13、,ABD,BCD,and ABCD.(n-2)3Exercise 3.2.2aExercise 3.2.2a+i)For the single 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 newdependencies are ABC,ABD,ACB,ACD,ADB,ADC,BCD
14、and BDC.+For the triples of attributes,BCD=BCD,but the closures of the other sets are eachABCD.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 andACD
15、B.+ii)For 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 newdependencies are ABD,ADC,BCA and CDB.For the triples of attributes,all the closures of the sets are each A
16、BCD.Thus,we getnew 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,ABCD,ABDC,ACDB and BCDA.+iii)For the single attributes we have A=ABCD,B =ABCD,C =ABCD,and D =ABCD.Thus,the new dependencies ar
17、e AC,AD,BD,BA,CA,CB,DB and DC.Since all the single attributes closures are ABCD,any superset of the singleattributes will also lead to a closure of ABCD.Knowing this,we can enumerate the restof the new dependencies.The collection of 24 new dependencies mentioned above are:AC,AD,BD,BA,CA,CB,DB,DC,ABC
18、,ABD,ACB,ACD,ADB,ADC,BCA,BCD,BDA,BDC,CDA,CDB,ABCD,ABDC,ACDB and BCDA.Exercise 3.2.2bExercise 3.2.2b4i)From the analysis of closures in 3.2.2a(i),we find that the only key is A.All othersets either do not have ABCD as the closure or contain A.ii)From the analysis of closures 3.2.2a(ii),we find that A
19、B,AD,BC,and CD are keys.All other sets either do not have ABCD as the closure or contain one of these four sets.iii)From the analysis of closures 3.2.2a(iii),we find that A,B,C and D are keys.Allother sets either do not have ABCD as the closure or contain one of these four sets.Exercise 3.2.2cExerci
20、se 3.2.2ci)The superkeys are all those sets that contain one of the keys in 3.2.2b(i).Thesuperkeys are AB,AC,AD,ABC,ABD,ACD,BCD and ABCD.ii)The superkeys are all those sets that contain one of the keys in 3.2.2b(ii).Thesuperkeys are ABC,ABD,ACD,BCD and ABCD.iii)The superkeys are all those sets that
21、contain one of the keys in 3.2.2b(iii).Thesuperkeys are AB,AC,AD,BC,BD,CD,ABC,ABD,ACD,BCD and ABCD.Exercise 3.2.3aExercise 3.2.3aSince A1A2AnC contains A1A2An,then the closure of A1A2AnC contains B.Thus it followsthat A1A2AnCB.Exercise 3.2.3bExercise 3.2.3bFrom 3.2.3a,we know that A1A2AnCB.Using the
22、 concept of trivial dependencies,we canshow that A1A2AnCC.Thus A1A2AnCBC.Exercise 3.2.3cExercise 3.2.3cFrom A1A2AnE1E2Ej,we know that the closure contains B1B2Bm because of the FD A1A2AnB1B2Bm.The B1B2Bm and the E1E2Ej combine to form the C1C2Ck.Thus the closure ofA1A2AnE1E2Ej contains D as well.Thu
23、s,A1A2AnE1E2EjD.Exercise 3.2.3dExercise 3.2.3dFrom A1A2AnC1C2Ck,we know that the closure contains B1B2Bm because of the FD A1A2AnB1B2Bm.The C1C2Ck also tell us that the closure of A1A2AnC1C2Ck contains D1D2Dj.Thus,A1A2AnC1C2CkB1B2BkD1D2Dj.Exercise 3.2.4aExercise 3.2.4aIf attribute A represented Soci
24、al Security Number and B represented a person s name,then we would assume AB but BA would not be valid because there may be many peoplewith the same name and different Social Security Numbers.5Exercise 3.2.4bExercise 3.2.4bLet attribute A represent Social Security Number,B represent gender and C rep
25、resent name.Surely Social Security Number and gender can uniquely identify a person s name(i.e.ABC).A Social Security Number can also uniquely identify a persons name(i.e.AC).However,gender does not uniquely determine a name(i.e.BC is not valid).Exercise 3.2.4cExercise 3.2.4cLet attribute A represen
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 数据库 系统 基础教程 第三 答案
![提示](https://www.taowenge.com/images/bang_tan.gif)
限制150内