数据库系统概念(database system concepts)英文第六版 课后练习
CHAPTER8
RelationalDatabaseDesignExercises
8.1SupposethatwedecomposetheschemaR=(A,B,C,D,E)into
(A,B,C)
(A,D,E).
Showthatthisdecompositionisalossless-joindecompositionifthefollowingsetFoffunctionaldependenciesholds:
A→BC
CD→E
B→D
E→A
Answer:Adecomposition{R1,R2}isalossless-joindecompositionifR1∩R2→R1orR1∩R2→R2.LetR1=(A,B,C),R2=(A,D,E),andR1∩R2=A.SinceAisacandidatekey(seePracticeExercise8.6),ThereforeR1∩R2→R1.
8.2Listallfunctionaldependenciessatis edbytherelationofFigure8.17.
Answer:Thenontrivialfunctionaldependenciesare:A→BandC→B,andadependencytheylogicallyimply:AC→B.Thereare19trivialfunctionaldependenciesoftheform → ,where .CdoesnotfunctionallydetermineAbecausethe rstandthirdtupleshavethesameCbutdifferentAvalues.ThesametuplesalsoshowBdoesnotfunctionallydetermineA.Likewise,AdoesnotfunctionallydetermineCbecausethe rsttwotupleshavethesameAvalueanddifferentCvalues.ThesametuplesalsoshowBdoesnotfunctionallydetermineC.Explainhowfunctionaldependenciescanbeusedtoindicatethefol-lowing:
98.3
10Chapter8RelationalDatabaseDesign
Aone-to-onerelationshipsetexistsbetweenentitysetsstudentandinstructor.
Amany-to-onerelationshipsetexistsbetweenentitysetsstudentandinstructor.
Answer:LetPk(r)denotetheprimarykeyattributeofrelationr.
ThefunctionaldependenciesPk(student)→Pk(instructor)andPk(instructor)→Pk(student)indicateaone-to-onerelationship
becauseanytwotupleswiththesamevalueforstudentmusthave
thesamevalueforinstructor,andanytwotuplesagreeingoninstructormusthavethesamevalueforstudent.
ThefunctionaldependencyPk(student)→Pk(instructor)indicatesamany-to-onerelationshipsinceanystudentvaluewhichisrepeatedwillhavethesameinstructorvalue,butmanystudentvaluesmayhavethesameinstructorvalue.
8.4UseArmstrong’saxiomstoprovethesoundnessoftheunionrule.(Hint:
Usetheaugmentationruletoshowthat,if → ,then → .Applytheaugmentationruleagain,using → ,andthenapplythetransitivityrule.)Answer:Toprovethat:
if → and → then →
Followingthehint,wederive:
→ given
→ augmentationrule
→ unionofidenticalsets
→ given
→ augmentationrule
→ transitivityruleandsetunioncommutativity
8.5UseArmstrong’saxiomstoprovethesoundnessofthepseudotransitiv-
ityrule.Answer:ProofusingArmstrong’saxiomsofthePseudotransitivityRule:
if → and → ,then → .
→ given
→ augmentationruleandsetunioncommutativity → given
→ transitivityrule
8.6ComputetheclosureofthefollowingsetFoffunctionaldependencies
forrelationschemaR=(A,B,C,D,E).
Exercises11
A→BC
CD→E
B→D
E→A
ListthecandidatekeysforR.Answer:+Note:ItisnotreasonabletoexpectstudentstoenumerateallofF.SomeshorthandrepresentationoftheresultshouldbeacceptableaslongasthenontrivialmembersofF+arefound.
StartingwithA→BC,wecanconclude:A→BandA→C.
SinceA→BandB→D,A→D(decomposition,
transitive)SinceA→CDandCD→E,A→E(union,decom-position,transi-tive)
SinceA→A,wehave(re exive)A→ABCDEfromtheabovesteps(union)
SinceE→A,E→ABCDE(transitive)
SinceCD→E,CD→ABCDE(transitive)SinceB→DandBC→CD,BC→(augmentative,ABCDEtransitive)Also,C→C,D→D,BD→D,etc.
Therefore,anyfunctionaldependencywithA,E,BC,orCDonthelefthandsideofthearrowisinF+,nomatterwhichotherattributesappearintheFD.Allow*torepresentanysetofattributesinR,thenF+isBD→B,BD→D,C→C,D→D,BD→BD,B→D,B→B,B→BD,andallFDsoftheformA → ,BC → ,CD → ,E → where isanysubsetof{A,B,C,D,E}.ThecandidatekeysareA,BC,CD,andE.
8.7UsingthefunctionaldependenciesofPracticeExercise8.6,computethe
canonicalcoverFc.Answer:ThegivensetofFDsFis:-
A→BC
CD→E
B→D
E→A
TheleftsideofeachFDinFisunique.AlsononeoftheattributesintheleftsideorrightsideofanyoftheFDsisextraneous.ThereforethecanonicalcoverFcisequaltoF.
12Chapter8RelationalDatabaseDesign
8.8ConsiderthealgorithminFigure8.18tocompute +.Showthatthisalgorithmismoreef cientthantheonepresentedinFigure8.8(Sec-tion8.4.2)andthatitcomputes +correctly.
Answer:Thealgorithmiscorrectbecause:
IfAisaddedtoresultthenthereisaproofthat →A.Toseethis,observethat → triviallyso iscorrectlypartofresult.IfA∈ isaddedtoresulttheremustbesomeFD → suchthat
A∈ and isalreadyasubsetofresult.(Otherwisefdcount
wouldbenonzeroandtheifconditionwouldbefalse.)Afullproofcanbegivenbyinductiononthedepthofrecursionforanexecutionofaddin,butsuchaproofcanbeexpectedonlyfromstudentswithagoodmathematicalbackground.
IfA∈ +,thenAiseventuallyaddedtoresult.Weprovethisbyinductiononthelengthoftheproofof →AusingArmstrong’saxioms.Firstobservethatifprocedureaddiniscalledwithsomeargument ,alltheattributesin willbeaddedtoresult.AlsoifaparticularFD’sfdcountbecomes0,alltheattributesinitstailwillde nitelybeaddedtoresult.Thebasecaseoftheproof,
A∈ A∈ +,isobviouslytruebecausethe rstcalltoaddinhastheargument .Theinductivehypothesesisthatif →AcanbeprovedinnstepsorlessthenA∈result.Ifthereisaproofinn+1stepsthat →A,thenthelaststepwasanapplicationof
eitherre exivity,augmentationortransitivityonafact → provedinnorfewersteps.Ifre exivityoraugmentationwasusedinthe(n+1)ststep,Amusthavebeeninresultbytheendofthenthstepitself.Otherwise,bytheinductivehypothesis result.
Thereforethedependencyusedinproving → ,A∈ willhavefdcountsetto0bytheendofthenthstep.HenceAwillbeaddedtoresult.
Toseethatthisalgorithmismoreef cientthantheonepresentedinthechapternotethatwescaneachFDonceinthemainprogram.TheresultingarrayappearshassizeproportionaltothesizeofthegivenFDs.Therecursivecallstoaddinresultinprocessinglinearinthesizeofappears.HencethealgorithmhastimecomplexitywhichislinearinthesizeofthegivenFDs.Ontheotherhand,thealgorithmgiveninthetexthasquadratictimecomplexity,asitmayperformtheloopasmanytimesasthenumberofFDs,ineachloopscanningallofth …… 此处隐藏:13540字,全部文档内容请下载后查看。喜欢就下载吧 ……
相关推荐:
- [行业范文]美好的法语句子
- [行业范文]描写露珠的句子
- [行业范文]精彩禅语句子图片
- [行业范文]关于满嘴谎言的句子
- [行业范文]关于安静的句子48句
- [行业范文]关于小河的句子
- [行业范文]描写稻田的句子
- [行业范文]思念好朋友的句子
- [行业范文]赞美雪的句子
- [行业范文]早上激励人心的句子
- [行业范文]失恋忧伤的句子
- [行业范文]努力积极向上的句子
- [行业范文]对工作心灰意冷的句子
- [行业范文]失恋让人心疼的句子
- [行业范文]描写珍惜青春的句子
- [行业范文]表达思念的句子简短
- [行业范文]关于父爱的句子范例
- [行业范文]浪漫的英语句子
- [行业范文]关于周末的句子
- [行业范文]思念牵挂的句子
- 有关感恩班会课件简短(二篇)(感恩班会
- 2025年初二下乡军训心得体会800字(15篇
- 关于新员工培训方案汇编(关于新员工培
- 精选高考生寒假学习计划书(精)(高考生
- 毕业实训报告心得体会(3篇)(实训报告心
- 银行工作感悟及心得范文怎么写(四篇)(
- 精选领导干部个人政治画像报告通用(七
- 精选超市11.11活动促销方案(精品超市品
- 2025年怎么做自我介绍汇总(5篇)(至2025
- 最新企业错峰生产方案(26篇)(山西企业
- 最新暑期三下乡社会实践调研报告范本(
- 最新幼儿园大班教育教学总结怎么写(最
- 最新教师节主持词小学(优秀9篇)(教师节
- 关于小学安全教育教学方案(推荐)(关于
- 员工信模板范文怎么写(五篇)(员工信息
- 最新保险销售离职申请书(十六篇)(最新
- 最新XX小学防校园欺凌工作方案怎么写(2
- 有关特岗教师辞职信范文(推荐)(特岗教
- 精选党的建设工作要点简短(党的建设的
- 如何写安康杯竞赛活动总结汇总(4篇)(安




