欢迎来到天天文库
浏览记录
ID:45337421
大小:626.26 KB
页数:45页
时间:2019-11-12
《数据库系统基础教程课后答案第四章》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、SolutionsChapter44.1.14.1.2a)b)c)Incweassumethataphoneandaddresscanonlybelongtoasinglecustomer(1-mrelationshiprepresentedbyarrowintocustomer).d)Indweassumethatanaddresscanonlybelongtoonecustomerandaphonecanexistatonlyoneaddress.Ifthemultiplicityofaboverelationshipswerem-to-
2、n,theentitysetbecomesweakandthekeyssNoofcustomerswillbeneededaspartofthecompositekeyoftheentityset.Inc&d,weconvertattributesphonesandaddressestoentitysets.Sinceentitysetsoftenbecomerelationsinrelationaldesign,wemustconsidermoreefficientalternatives.Insteadofqueryingmultiple
3、tableswherekeyvaluesareduplicated,wecanalsomodifyattributes:(i)PhonesattributecanbeconvertedintoHomePhone,OfficePhoneandCellPhone.(ii)Amultivaluedattributesuchasaliascanbekeptasanattributewhereasinglecolumncanbeusedinrelationaldesigni.e.concatenateallvalues.SQLallowsaquery"
4、like'%Junius%'"tosearchthemultiplevaluesinacolumnalias.4.1.34.1.4a)b)c)Therelationship"played"betweenTeamsandPlayersissimilartorelationship"plays"betweenTeamsandPlayers.4.1.54.1.6TheinformationaboutchildrencanbeascertainedfrommotherOfandfatherOfrelationships.AttributessNois
5、requiredsincenamesarenotunique.4.1.74.1.8a)(b)4.1.9AssumptionsAProfessoronlyworksinatmostonedepartment.AcoursehasatmostoneTA.Acourseisonlytaughtbyoneprofessorandofferedbyonedepartment.Studentsandprofessorshavebeenassigneduniqueemailids.Acourseisuniquelyidentifiedbythecourse
6、no,sectionno,andsemester(e.g.cs157-3spring09).4.1.10Giventhatforeachmovie,auniquestudioexiststhatproducesthemovie.Eachstariscontractedtoatmostonestudio.Butstarscouldbeunemployedatagiventime.Thusthefour-wayrelationshipinfig4.6canbeeasilyintoconvertedequivalentrelationships.4
7、.2.1Redundancy:TheowneraddressisrepeatedinAccSetsandAddressesentitysets.Simplicity:AccSetsdoesnotserveanyusefulpurposeandthedesigncanbemoresimplyrepresentedbycreatingmany-to-manyrelationshipbetweenCustomersandAccounts.Rightkindofelement:TheentitysetAddresseshasasingleattrib
8、uteaddress.Acustomercannothavemorethanoneaddress.Henceaddressshouldbeanattributeof
此文档下载收益归作者所有