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

上传人:b****3 文档编号:895835 上传时间:2022-10-13 格式:DOCX 页数:33 大小:30.36KB
下载 相关 举报
数据库系统基础教程第三章答案.docx_第1页
第1页 / 共33页
数据库系统基础教程第三章答案.docx_第2页
第2页 / 共33页
数据库系统基础教程第三章答案.docx_第3页
第3页 / 共33页
数据库系统基础教程第三章答案.docx_第4页
第4页 / 共33页
数据库系统基础教程第三章答案.docx_第5页
第5页 / 共33页
点击查看更多>>
下载资源
资源描述

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

《数据库系统基础教程第三章答案.docx》由会员分享,可在线阅读,更多相关《数据库系统基础教程第三章答案.docx(33页珍藏版)》请在冰豆网上搜索。

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

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

Exercise3、1、1

Answersforthisexercisemayvarybecauseofdifferentinterpretations、

SomepossibleFDs:

SocialSecuritynumber→name

Areacode→state

Streetaddress,city,state→zipcode

Possiblekeys:

{SocialSecuritynumber,streetaddress,city,state,areacode,phonenumber}

Needstreetaddress,city,statetouniquelydeterminelocation、Apersoncouldhavemultipleaddresses、Thesameistrueforphones、Thesedays,apersoncouldhavealandlineandacellularphone

Exercise3、1、2

Answersforthisexercisemayvarybecauseofdifferentinterpretations

SomepossibleFDs:

ID→x-position,y-position,z-position

ID→x-velocity,y-velocity,z-velocity

x-position,y-position,z-position→ID

Possiblekeys:

{ID}

{x-position,y-position,z-position}

Thereasonwhythepositionswouldbeakeyisnotwomoleculescanoccupythesamepoint、

Exercise3、1、3a

ThesuperkeysareanysubsetthatcontainsA1、Thus,thereare2(n-1)suchsubsets,sinceeachofthen-1attributesA2throughAnmayindependentlybechoseninorout、

Exercise3、1、3b

ThesuperkeysareanysubsetthatcontainsA1orA2、Thereare2(n-1)suchsubsetswhenconsideringA1andthen-1attributesA2throughAn、Thereare2(n-2)suchsubsetswhenconsideringA2andthen-2attributesA3throughAn、WedonotcountA1inthesesubsetsbecausetheyarealreadycountedinthefirstgroupofsubsets、Thetotalnumberofsubsetsis2(n-1)+2(n-2)、

Exercise3、1、3c

Thesuperkeysareanysubsetthatcontains{A1,A2}or{A3,A4}、Thereare2(n-2)suchsubsetswhenconsidering{A1,A2}andthen-2attributesA3throughAn、Thereare2(n-2)–2(n-4)suchsubsetswhenconsidering{A3,A4}andattributesA5throughAnalongwiththeindividualattributesA1andA2、Wegetthe2(n-4)termbecausewehavetodiscardthesubsetsthatcontainthekey{A1,A2}toavoiddoublecounting、Thetotalnumberofsubsetsis2(n-2)+2(n-2)–2(n-4)、

Exercise3、1、3d

Thesuperkeysareanysubsetthatcontains{A1,A2}or{A1,A3}、Thereare2(n-2)suchsubsetswhenconsidering{A1,A2}andthen-2attributesA3throughAn、Thereare2(n-3)suchsubsetswhenconsidering{A1,A3}andthen-3attributesA4throughAnWedonotcountA2inthesesubsetsbecausetheyarealreadycountedinthefirstgroupofsubsets、Thetotalnumberofsubsetsis2(n-2)+2(n-3)、

Exercise3、2、1a

Wecouldtryinferencerulestodeducenewdependenciesuntilwearesatisfiedwehavethemall、Amoresystematicwayistoconsidertheclosuresofall15nonemptysetsofattributes、

Forthesingleattributeswehave{A}+=A,{B}+=B,{C}+=ACD,and{D}+=AD、Thus,theonlynewdependencywegetwithasingleattributeontheleftisC→A、

Nowconsiderpairsofattributes:

{AB}+=ABCD,sowegetnewdependencyAB→D、{AC}+=ACD,andAC→Disnontrivial、{AD}+=AD,sonothingnew、{BC}+=ABCD,sowegetBC→A,andBC→D、{BD}+=ABCD,givingusBD→AandBD→C、{CD}+=ACD,givingCD→A、

Forthetriplesofattributes,{ACD}+=ACD,buttheclosuresoftheothersetsareeachABCD、Thus,wegetnewdependenciesABC→D,ABD→C,andBCD→A、

Since{ABCD}+=ABCD,wegetnonewdependencies、

Thecollectionof11newdependenciesmentionedaboveare:

C→A,AB→D,AC→D,BC→A,BC→D,BD→A,BD→C,CD→A,ABC→D,ABD→C,andBCD→A、

Exercise3、2、1b

Fromtheanalysisofclosuresabove,wefindthatAB,BC,andBDarekeys、AllothersetseitherdonothaveABCDastheclosureorcontainoneofthesethreesets、

Exercise3、2、1c

Thesuperkeysareallthosethatcontainoneofthosethreekeys、Thatis,asuperkeythatisnotakeymustcontainBandmorethanoneofA,C,andD、Thus,the(proper)superkeysareABC,ABD,BCD,andABCD、

Exercise3、2、2a

i)Forthesingleattributeswehave{A}+=ABCD,{B}+=BCD,{C}+=C,and{D}+=D、Thus,thenewdependenciesareA→CandA→D、

Nowconsiderpairsofattributes:

{AB}+=ABCD,{AC}+=ABCD,{AD}+=ABCD,{BC}+=BCD,{BD}+=BCD,{CD}+=CD、ThusthenewdependenciesareAB→C,AB→D,AC→B,AC→D,AD→B,AD→C,BC→DandBD→C、

Forthetriplesofattributes,{BCD}+=BCD,buttheclosuresoftheothersetsareeachABCD、Thus,wegetnewdependenciesABC→D,ABD→C,andACD→B、

Since{ABCD}+=ABCD,wegetnonewdependencies、

Thecollectionof13newdependenciesmentionedaboveare:

A→C,A→D,AB→C,AB→D,AC→B,AC→D,AD→B,AD→C,BC→D,BD→C,ABC→D,ABD→CandACD→B、

ii)Forthesingleattributeswehave{A}+=A,{B}+=B,{C}+=C,and{D}+=D、Thus,therearenonewdependencies、

Nowconsiderpairsofattributes:

{AB}+=ABCD,{AC}+=AC,{AD}+=ABCD,{BC}+=ABCD,{BD}+=BD,{CD}+=ABCD、ThusthenewdependenciesareAB→D,AD→C,BC→AandCD→B、

Forthetriplesofattributes,alltheclosuresofthesetsareeachABCD、Thus,wegetnewdependenciesABC→D,ABD→C,ACD→BandBCD→A、

Since{ABCD}+=ABCD,wegetnonewdependencies、

Thecollectionof8newdependenciesmentionedaboveare:

AB→D,AD

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 解决方案 > 学习计划

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1