欢迎来到淘文阁 - 分享文档赚钱的网站! | 帮助中心 好文档才是您的得力助手!
淘文阁 - 分享文档赚钱的网站
全部分类
  • 研究报告>
  • 管理文献>
  • 标准材料>
  • 技术资料>
  • 教育专区>
  • 应用文书>
  • 生活休闲>
  • 考试试题>
  • pptx模板>
  • 工商注册>
  • 期刊短文>
  • 图片设计>
  • ImageVerifierCode 换一换

    数据库系统基础教学教材第三章答案.doc

    • 资源ID:655309       资源大小:314KB        全文页数:31页
    • 资源格式: DOC        下载积分:10金币
    快捷下载 游客一键下载
    会员登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录   QQ登录  
    二维码
    微信扫一扫登录
    下载资源需要10金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    数据库系统基础教学教材第三章答案.doc

    -_ExerciseExercise 3.1.13.1.1Answers for this exercise may vary because of different interpretations.Some possible FDs: Social Security number name Area code state Street address, city, state zipcodePossible keys: Social Security number, street address, city, state, area code, phone numberNeed street address, city, state 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 phoneExerciseExercise 3.1.23.1.2Answers for this exercise may vary because of different interpretationsSome possible FDs: ID x-position, y-position, z-position ID x-velocity, y-velocity, z-velocity x-position, y-position, z-position IDPossible keys: ID x-position, y-position, z-positionThe reason why the positions would be a key is no two molecules can occupy the same point.ExerciseExercise 3.1.3a3.1.3aThe superkeys are any subset that contains A1. Thus, there are 2(n-1) such subsets, since each of the n-1 attributes A2 through An may independently be chosen in or out.ExerciseExercise 3.1.3b3.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 considering 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).ExerciseExercise 3.1.3c3.1.3c-_The superkeys are any subset that contains A1,A2 or A3,A4. There are 2(n-2) such subsets 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 double counting. The total number of subsets is 2(n-2) + 2(n-2) 2(n-4).ExerciseExercise 3.1.3d3.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 attributes 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).ExerciseExercise 3.2.1a3.2.1aWe could try inference rules to deduce new dependencies until we are satisfied we have them all. A more systematic 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. 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 each ABCD. 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. ExerciseExercise 3.2.1b3.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 closure or contain one of these three sets.ExerciseExercise 3.2.1c3.2.1c-_The 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.ExerciseExercise 3.2.2a3.2.2ai) 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 new dependencies are ABC, ABD, ACB, ACD, ADB, ADC, BCD and BDC.For the triples of attributes, 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 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, 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 are AC, AD, BD, BA, CA, CB, DB and DC.Since all the single attributes closures are ABCD, any superset of the single attributes will also lead to a closure of ABCD. Knowing this, we can enumerate the rest of the new dependencies.The collection of 24 new dependencies mentioned above are: -_AC, AD, BD, BA, CA, CB, DB, DC, ABC, ABD, ACB, ACD, ADB, ADC, BCA, BCD, BDA, BDC, CDA, CDB, ABCD, ABDC, ACDB and BCDA.ExerciseExercise 3.2.2b3.2.2bi) From the analysis of closures in 3.2.2a(i), we find that the only key is A. All other sets either do not have ABCD as the closure or contain A.ii) From the analysis of closures 3.2.2a(ii), we find that AB, 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. All other sets either do not have ABCD as the closure or contain one of these four sets.ExerciseExercise 3.2.2c3.2.2ci) The superkeys are all those sets that contain one of the keys in 3.2.2b(i). The superkeys 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). The superkeys are ABC, ABD, ACD, BCD and ABCD.iii) The superkeys are all those sets that contain one of the keys in 3.2.2b(iii). The superkeys are AB, AC, AD, BC, BD, CD, ABC, ABD, ACD, BCD and ABCD.ExerciseExercise 3.2.3a3.2.3aSince A1A2AnC contains A1A2An, then the closure of A1A2AnC contains B. Thus it follows that A1A2AnCB.ExerciseExercise 3.2.3b3.2.3bFrom 3.2.3a, we know that A1A2AnCB. Using the concept of trivial dependencies, we can show that A1A2AnCC. Thus A1A2AnCBC. ExerciseExercise 3.2.3c3.2.3cFrom A1A2AnE1E2Ej, we know that the closure contains B1B2Bm because of the FD A1A2An B1B2Bm. The B1B2Bm and the E1E2Ej combine to form the C1C2Ck. Thus the closure of A1A2AnE1E2Ej contains D as well. Thus, A1A2AnE1E2EjD.ExerciseExercise 3.2.3d3.2.3dFrom A1A2AnC1C2Ck, we know that the closure contains B1B2Bm because of the FD A1A2An B1B2Bm. The C1C2Ck also tell us that the closure of A1A2AnC1C2Ck contains D1D2Dj. Thus, A1A2AnC1C2CkB1B2BkD1D2Dj. -_ExerciseExercise 3.2.4a3.2.4a If attribute A represented Social Security Number and B represented a persons name, then we would assume AB but BA would not be valid because there may be many people with the same name and different Social Security Numbers.ExerciseExercise 3.2.4b3.2.4bLet attribute A represent Social Security Number, B represent gender and C represent name. Surely Social Security Number and gender can uniquely identify a persons 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).ExerciseExercise 3.2.4c3.2.4cLet attribute A represent latitude and B represent longitude. Together, both attributes can uniquely determine C, a point on the world map (i.e. ABC). However, neither A nor B can uniquely identify a point (i.e. AC and BC are not valid).ExerciseExercise 3.2.53.2.5Given a relation with attributes A1A2An, we are told that there are no functional dependencies of the form B1B2Bn-1C where B1B2Bn-1 is n-1 of the attributes from A1A2An and C is the remaining attribute from A1A2An. In this case, the set B1B2Bn-1 and any subset do not functionally determine C. Thus the only functional dependencies that we can make are ones where C is on both the left and right hand sides. All of these functional dependencies would be trivial and thus the relation has no nontrivial FDs.ExerciseExercise 3.2.63.2.6Lets prove this by using the contrapositive. We wish to show that if X+ is not a subset of Y+, then it must be that X is not a subset of Y. If X+ is not a subset of Y+, there must be attributes A1A2An in X+ that are not in Y+. If any of these attributes were originally in X, then we are done because Y does not contain any of the A1A2An. However, if the A1A2An were added by the closure, then we must examine the case further. Assume that there was some FD C1C2CmA1A2Aj where A1A2Aj is some subset of A1A2An. It must be then that C1C2Cm or some subset of C1C2Cm is in X. However, the attributes C1C2Cm cannot be in Y because we assumed that attributes A1A2An are only in X+ and are not in Y+. Thus, X is not a subset of Y.By proving the contrapositive, we have also proved if X Y, then X+ Y+.ExerciseExercise 3.2.73.2.7The algorithm to find X+ is outlined on pg. 76. Using that algorithm, we can prove that (X+)+ = X+. We will do this by using a proof by contradiction.-_Suppose that (X+)+ X+. Then for (X+)+, it must be that some FD allowed additional attributes to be added to the original set X+. For example, X+ A where A is some attribute not in X+. However, if this were the case, then X+ would not be the closure of X. The closure of X would have to include A as well. This contradicts the fact that we were given the closure of X, X+. Therefore, it must be that (X+)+ = X+ or else X+ is not the closure of X.ExerciseExercise 3.2.8a3.2.8aIf all sets of attributes are closed, then there cannot be any nontrivial functional dependencies. Suppose A1A2.AnB is a nontrivial dependency. Then A1A2.An+ contains B and thus A1A2.An is not closed.ExerciseExercise 3.2.8b3.2.8bIf the only closed sets are ø and A,B,C,D, then the following FDs hold:ABACAD BABCBD CACBCD DADBDC ABCABD ACBACD ADBADC BCABCD BDABDC CDACDB ABCD ABDC ACDB BCDAExerciseExercise 3.2.8c3.2.8cIf the only closed sets are ø, A,B and A,B,C,D, then the following FDs hold:AB BA CACBCD DADBDC ACBACD ADBADC BCABCD BDABDC CDACDB ABCD-_ABDC ACDB BCDAExerciseExercise 3.2.93.2.9We can think of this problem as a situation where the attributes A,B,C represent cities and the functional dependencies represent one way paths between the cities. The minimal bases are the minimal number of pathways that are needed to connect the cities. We do not want to create another roadway if the two cities are already connected.The systematic way to do this would be to check all possible sets of the pathways. However, we can simplify the situation by noting that it takes more than two pathways to visit the two other cities and come back. Also, if we find a set of pathways that is minimal, adding additional pathways will not create another minimal set.The two sets of minimal bases that were given in example 3.11 are:AB, BC, CA AB, BA, BC, CBThe additional sets of minimal bases are:CB, BA, AC AB, AC, BA, CA AC, BC, CA, CBExerciseExercise 3.2.10a3.2.10aWe need to compute the closures of all subsets of ABC, although there is no need to think about the empty set or the set of all three attributes. Here are the calculations for the remaining six sets: A+=A B+=B C+=ACE AB+=ABCDE AC+=ACE BC+=ABCDEWe ignore D and E, so a basis for the resulting functional dependencies for ABC is: CA and ABC. Note that BC->A is true, but follows logically from C->A, and therefore may be omitted from our list.ExerciseExercise 3.2.10b3.2.10b-_We need to compute the closures of all subsets of ABC, although there is no need to think about the empty set or the set of all three attributes. Here are the calculations for the remaining six sets: A+=AD B+=B C+=C AB+=ABDE AC+=ABCDE BC+=BCWe ignore D and E, so a basis for the resulting functional dependencies for ABC is: ACB.ExerciseExercise 3.2.10c3.2.10cWe need to compute the closures of all subsets of ABC, although there is no need to think about the empty set or the set of all three attributes. Here are the calculations for the remaining six sets: A+=A B+=B C+=C AB+=ABD AC+=ABCDE BC+=ABCDEWe ignore D and E, so a basis for the resulting functional dependencies for ABC is: ACB and BCA.ExerciseExercise 3.2.10d3.2.10dWe need to compute the closures of all subsets of ABC, although there is no need to think about the empty set or the set of all three attributes. Here are the calculations for the remaining six sets: A+=ABCDE B+=ABCDE C+=ABCDE AB+=ABCDE AC+=ABCDE BC+=ABCDEWe ignore D and E, so a basis for the resulting functional dependencies for ABC is: AB, BC and CA.ExerciseExercise 3.2.113.2.11For step one of Algorithm 3.7, suppose we have the FD ABCDE. We want to use Armstrongs Axioms to show that ABCD and ABCE follow. Surely the functional -_dependencies DED and DEE hold because they are trivial and follow the reflexivity property. Using the transitivity rule, we can derive the FD ABCD from the FDs ABCDE and DED. Likewise, we can do the same for ABCDE and DEE and derive the FD ABCE.For steps two through four of Algorithm 3.7, suppose we have the initial set of attributes of the closure as ABC. Suppose also that we have FDs CD and DE. According to Algorithm 3.7, the closure should become ABCDE. Taking the FD CD and augmenting both sides with attributes AB we get the FD ABCABD. We can use the splitting method in step one to get the FD ABCD. Since D is not in the closure, we can add attribute D. Taking the FD DE and augmenting both sides with attributes ABC we get the FD ABCDABCDE. Using again the splitting method in step one we get the FD ABCDE. Since E is not in the closure, we can add attribute E.Given a set of FDs, we can prove that a FD F follows by taking the closure of the left side of FD F. The steps to compute the closure in Algorithm 3.7 can be mimicked by Armstrongs axioms and thus we can prove F from the given set of FDs using Armstrongs axioms. ExerciseEx

    注意事项

    本文(数据库系统基础教学教材第三章答案.doc)为本站会员(小**)主动上传,淘文阁 - 分享文档赚钱的网站仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知淘文阁 - 分享文档赚钱的网站(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于淘文阁 - 版权申诉 - 用户使用规则 - 积分规则 - 联系我们

    本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

    工信部备案号:黑ICP备15003705号 © 2020-2023 www.taowenge.com 淘文阁 

    收起
    展开