ImageVerifierCode 换一换
格式:DOC , 页数:35 ,大小:546KB ,
资源ID:4353511      下载积分:12 金币
快捷注册下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

开通VIP
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.zixin.com.cn/docdown/4353511.html】到电脑端继续下载(重复下载【60天内】不扣币)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

开通VIP折扣优惠下载文档

            查看会员权益                  [ 下载后找不到文档?]

填表反馈(24小时):  下载求助     关注领币    退款申请

开具发票请登录PC端进行申请

   平台协调中心        【在线客服】        免费申请共赢上传

权利声明

1、咨信平台为文档C2C交易模式,即用户上传的文档直接被用户下载,收益归上传人(含作者)所有;本站仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。所展示的作品文档包括内容和图片全部来源于网络用户和作者上传投稿,我们不确定上传用户享有完全著作权,根据《信息网络传播权保护条例》,如果侵犯了您的版权、权益或隐私,请联系我们,核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
2、文档的总页数、文档格式和文档大小以系统显示为准(内容中显示的页数不一定正确),网站客服只以系统显示的页数、文件格式、文档大小作为仲裁依据,个别因单元格分列造成显示页码不一将协商解决,平台无法对文档的真实性、完整性、权威性、准确性、专业性及其观点立场做任何保证或承诺,下载前须认真查看,确认无误后再购买,务必慎重购买;若有违法违纪将进行移交司法处理,若涉侵权平台将进行基本处罚并下架。
3、本站所有内容均由用户上传,付费前请自行鉴别,如您付费,意味着您已接受本站规则且自行承担风险,本站不进行额外附加服务,虚拟产品一经售出概不退款(未进行购买下载可退充值款),文档一经付费(服务费)、不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
4、如你看到网页展示的文档有www.zixin.com.cn水印,是因预览和防盗链等技术需要对页面进行转换压缩成图而已,我们并不对上传的文档进行任何编辑或修改,文档下载后都不会有水印标识(原文档上传前个别存留的除外),下载后原文更清晰;试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓;PPT和DOC文档可被视为“模板”,允许上传人保留章节、目录结构的情况下删减部份的内容;PDF文档不管是原文档转换或图片扫描而得,本站不作要求视为允许,下载前可先查看【教您几个在下载文档中可以更好的避免被坑】。
5、本文档所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用;网站提供的党政主题相关内容(国旗、国徽、党徽--等)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
6、文档遇到问题,请及时联系平台进行协调解决,联系【微信客服】、【QQ客服】,若有其他问题请点击或扫码反馈【服务填表】;文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“【版权申诉】”,意见反馈和侵权处理邮箱:1219186828@qq.com;也可以拔打客服电话:0574-28810668;投诉电话:18658249818。

注意事项

本文(数据库系统基础教程第四章答案.doc)为本站上传会员【丰****】主动上传,咨信网仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知咨信网(发送邮件至1219186828@qq.com、拔打电话4009-655-100或【 微信客服】、【 QQ客服】),核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载【60天内】不扣币。 服务填表

数据库系统基础教程第四章答案.doc

1、Solutions Chapter 4 4、1、1 4、1、2 a) b) c) In c we assume that a phone and address can only belong to a single customer (1-m relationship represented by arrow into customer)、 d) In d we assume that an address can only belong to one customer and a phone can exist at only o

2、ne address、 If the multiplicity of above relationships were m-to-n, the entity set bees weak and the key ssNo of customers will be needed as part of the posite key of the entity set、 In c&d, we convert attributes phones and addresses to entity sets、 Since entity sets often bee relations in relatio

3、nal design, we must consider more efficient alternatives、 Instead of querying multiple tables where key values are duplicated, we can also modify attributes: (i) Phones attribute can be converted into HomePhone, OfficePhone and CellPhone、 (ii) A multivalued attribute such as alias can be

4、 kept as an attribute where a single column can be used in relational design i、e、 concatenate all values、 SQL allows a query "like '%Junius%'" to search the multiple values in a column alias、 4、1、3 4、1、4 a) b) c) The relationship "played" between Teams and Players is similar to relat

5、ionship "plays" between Teams and Players、 4、1、5 4、1、6 The information about children can be ascertained from motherOf and fatherOf relationships、 Attribute ssNo is required since names are not unique、 4、1、7 4、1、8 a) (b) 4、1、9 Assumptions A Professor only works in at most one de

6、partment、 A course has at most one TA、 A course is only taught by one professor and offered by one department、 Students and professors have been assigned unique email ids、 A course is uniquely identified by the course no, section no, and semester (e、g、 cs157-3 spring 09)、 4、1、10 Given that f

7、or each movie, a unique studio exists that produces the movie、 Each star is contracted to at most one studio、 But stars could be unemployed at a given time、 Thus the four-way relationship in fig 4、6 can be easily into converted equivalent relationships、 4、2、1 Redundancy: The owner address is r

8、epeated in AccSets and Addresses entity sets、 Simplicity: AccSets does not serve any useful purpose and the design can be more simply represented by creating many-to-many relationship between Customers and Accounts、 Right kind of element: The entity set Addresses has a single attribute address、 A

9、customer cannot have more than one address、 Hence address should be an attribute of entity set Customers、 Faithfulness: Customers cannot be uniquely identified by their names、 In real world Customers would have a unique attribute such as ssNo or customerNo 4、2、2 Studios and Presidents can be bi

10、ned into one entity set Studios with Presidents being an attribute of Studios under following circumstances: 1、 The Presidents entity set only contains a simple attribute viz、 presidentName、 Additional attributes specific to Presidents might justify making Presidents into an entity set、 4、2、3

11、 4、2、4 The entity sets should have single attribute、 a) Stars: starName b) Movies: movieName c) Studios: studioName、 However there exists a many-to-many relationship between Studios and Contracts、 Hence, in addition, we need more information about studios involved、 If a contract always involves

12、 two studios, two attributes such as producingStudio and starStudio can replace the Studios entity set、 If a contact can be associated with at most five studios, it may be possible to replace the Studios entity set by five attributes viz、 studio1, studio2, studio3, studio4, and studio5、 Alternatel

13、y, a posite attribute containing concatenation of all studio names in a contact can be considered、 A separator character such as "$" can be used、 SQL allows searching of such an attribute using query like '%keyword%' 4、2、5 From Augmentation rule of Functional Dependency, given B -> M (B=Baby,

14、 M=Mother) then BND -> M (N=Nurse, D=Doctor) Hence we can just put an arrow entering mother、 a) Put an arrow entering entity set Mothers for the simplest solution (As in fig、 4、4, where a multi-way relationship was allowed, even though Movies alone could identify the Studio)、 However, we can di

15、splay more accurate information with below figure、 b) c) Again from Augmentation rule of Functional Dependency, given BM -> D then BMN -> D Thus we can just add an arrow entering Doctors to fig 4、15、 Below figure represents more accurate information however、 4、2、6 a) b) Transit

16、ivity and Augmentation rules of Functional Dependency allow arrow entering Mothers from Births、 However, a new relationship in below figure represents more accurate information、 c) Design flaws in abc above 1、 As suggested above, using Transitivity and Augmentation rules of Functional Dependen

17、cy, much simpler design is possible、 4、2、7 In below figure there exists a many-to-one relationship between Babies and Births and another many-to-one relationship between Births and Mothers、 From transitivity of relationships, there is a many-to-one relationship between Babies and Mothers、 Hence

18、 a baby has a unique mother while a birth can allow more than one baby、 4、3、1 a) b) A captain cannot exist without a team、 However a player can (free agent)、 A recently formed (or defunct) team can exist without players or colors、 c) Children can exist without mother and father (unknown)

19、 4、3、2 a) The keys of both E1 and E2 are required for uniquely identifying tuples in R b) The key of E1 c) The key of E2 d) The key of either E1 or E2 4、3、3 Special Case: All entity sets have arrows going into them i、e、 all relationships are 1-to-1 Any Ki Otherwise: bin

20、ation of all Ki's where there does not exist an arrow going from R to Ei、 4、4、1 No, grade is not part of the key for enrollments、 The keys of Students and Courses bee keys of the weak entity set Enrollments、 4、4、2 It is possible to make assignment number a weak key of Enrollments but this is

21、 not good design (redundancy since multiple assignments correspond to a course)、 A new entity set Assignment is created and it is also a weak entity set、 Hence the key attributes of Assignment will e from the strong entity sets to which Enrollments is connected i、e、 studentID, dept, and CourseNo、

22、 4、4、3 a) b) c) 4、4、4 a) b) 4、5、1 Customers(SSNo,name,addr,phone) Flights(number,day,aircraft) Bookings(custSSNo,flightNo,flightDay,row,seat) Relations for toCust and toFlt relationships are not required since the weak entity set Bookings already contains the keys of Customers a

23、nd Flights、 4、5、2 (a) (b) Schema is changed、 Since toCust is no longer an identifying relationship, SSNo is no longer a part of Bookings relation、 Bookings(flightNo,flightDay,row,seat) ToCust(custSSNO,flightNo,flightDay,row,seat) The above relations are merged into Bookings(flightNo,flight

24、Day,row,seat,custSSNo) However custSSNo is no longer a key of Bookings relation、 It bees a foreign key instead、 4、5、3 Ships(name, yearLaunched) SisterOf(name, sisterName) 4、5、4 (a) Stars(name,addr) Studios(name,addr) Movies(title,year,length,genre) Contracts(starName,movieTitle,m

25、ovieYear,studioName,salary) Depending on other relationships not shown in ER diagram, studioName may not be required as a key of Contracts (or not even required as an attribute of Contracts)、 (b) Students(studentID) Courses(dept,courseNo) Enrollments(studentID,dept,courseNo,grade) (c) Departm

26、ents(name) Courses(deptName,number) (d) Leagues(name) Teams(leagueName,teamName) Players(leagueName,teamName,playerName) 4、6、1 The weak relation Courses has the key from Depts along with number、 Hence there is no relation for GivenBy relationship、 (a) Depts(name, chair) Courses

27、number, deptName, room) LabCourses(number, deptName, allocation) (b) LabCourses has all the attributes of Courses、 Depts(name, chair) Courses(number, deptName, room) LabCourses(number, deptName, room, allocation) (c) Courses and LabCourses are bined into one relation、

28、 Depts(name, chair) Courses(number, deptName, room, allocation) 4、6、2 (a) Person(name,address) ChildOf(personName,personAddress,childName,childAddress) Child(name,address,fatherName,fatherAddress,motherName,motherAddresss) Father(name,address,wifeName,wifeAddresss) Mother(name,address)

29、 Since FatherOf and MotherOf are many-one relationships from Child, there is no need for a separate relation for them、 Similarly the one-one relationship Married can be included in Father (or Mother)、 ChildOf is a many-many relationship and needs a separate relation、 However the ChildOf relation

30、 is not required since the relationship can be deduced from FatherOf and MotherOf relationships contained in Child relation、 (b) A person cannot be both Mother and Father、 Person(name,address) PersonChild(name,address) PersonChildFather(name,address) PersonChildMother(name,address) PersonFat

31、her(name,address) PersonMother(name,address) ChildOf(personName,personAddress,childName,childAddress) FatherOf(childName,childAddress,fatherName,fatherAddress) MotherOf(childName,childAddress,motherName,motherAddress) Married(husbandName,husbandAddress,wifeName,wifeAddress) The many-many Child

32、Of relationship again requires a relation、 An entity belongs to one and only one class when using object-oriented approach、 Hence, the many-one relations MotherOf and FatherOf could be added as attributes to PersonChild,PersonChildFather, and PersonChildMother relations、 Similarly the Married rela

33、tion can be added as attributes to PersonChildMother and PersonMother (or the corresponding father relations)、 (c) For the Person relation at least one of husband and wife attributes will be null、 Person(personName,personAddress,fatherName,fatherAddress,motherName,motherAddresss,wifeName,wifeAddr

34、esss,husbandName,husbandAddress) ChildOf(personName,personAddress,childName,childAddress) 4、6、3 (a) People(name,fatherName,motherName) Males(name) Females(name) Fathers(name) Mothers(name) ChildOf(personName,childName) (b) People(name) PeopleMale(name) PeopleMaleFathers(name) PeopleFem

35、ale(name) PeopleFemaleMothers(name) ChildOf(personName,childName) FatherOf(childName,fatherName) MotherOf(childName,motherName) People cannot belong to both male and female branch of the ER diagram、 Moreover since an entity belongs to one and only one class when using object-oriented approach,

36、 no entity belongs to People relation、 Again we could replace MotherOf and FatherOf relations by adding as attributes to PeopleMale,PeopleMaleFathers,PeopleFemale, and PeopleFemaleMothers relations、 (c) People(name,fatherName,motherName) ChildOf(personName,childName) 4、6、4 (a) Each entity set

37、 results in one relation、 Thus both the minimum and maximum number of relations is e、 The root relation has a attributes including k keys、 Thus the minimum number of attributes is a、 All other relations include the k keys from root along with their a attributes、 Thus the maximum number of attribute

38、s is a+k、 (b) The relation for root will have a attributes、 The relation representing the whole tree will have e*a attributes、 The number of relations will depend on the shape of the tree、 A tree of e entities where only one child exists(say left child only) would have the minimum number of relat

39、ions、 Thus below figure will only contain 4 subtrees that contain root E1,E1E2,E1E2E3, and E1E2E3E4、 With e entity sets, minimum e relations are possible、 The maximum number of subtrees result when all the entities(except root) are at depth 1、 Thus below figure will contain 8 subtrees that contai

40、n root E1,E1E2,E1E3,E1E4,E1E2E3,E1E3E4,E1E2E4,and E1E2E3E4、 With e entity sets, maximum 2^(e-1) relations are possible、 (c) The nulls method always results in one relation and contains attributes from all e entities i、e、 e*a attributes、 Summarizing for a,b, and c above; #p

41、onents #Relations Min Max Min Max Method straight-E/R a a e e object-oriented a e*a e 2^(e-1) nulls e*a e*a 1 1 4、7、1 4、7、2 a) b) c) d) 4、7、3 4、7、4 4、7、5 Mal

42、es and Females subclasses are plete、 Mothers and Fathers are partial、 All subclasses are disjoint、 4、7、6 4、7、7 4、7、8 We convert the ternary relationship Contracts into three binary relationships between a new entity set Contracts and existing entity sets、 4、7、9 a) b) c) 4、7、10

43、 A self-association ParentOf for entity set people has multiplicity 0、、2 at parent role end、 In a Library database, if a patron can loan at most 12 books, them multiplicity is 0、、12、 For a FullTimeStudents entity set, a relationship of multiplicity 5、、* must exist with Courses (A student must tak

44、e at least 5 courses to be classified FullTime、 4、8、1 Customers(SSNo,name,addr,phone) Flights(number,day,aircraft) Bookings(row,seat,custSSNo,FlightNumber,FlightDay) Customers("SSNo",name,addr,phone) Flights("number","day",aircraft) Bookings(row,seat,"custSSNo","FlightNumber","FlightDay") 4

45、8、2 a) Movies(title,year,length,genre) Studios(name,address) Presidents(cert#,name,address) Owns(movieTitle,movieYear,studioName) Runs(studioName,presCert#) Movies("title","year",length,genre) Studios("name",address) Presidents("cert#",name,address) Owns("movieTitle","movieYear",studioNam

46、e) Runs("studioName",presCert#) b) Since the subclasses are disjoint, Object Oriented Approach is used、 The hierarchy is not plete、 Hence four relations are required Movies(title,year,length,genre) MurderMysteries(title,year,length,genre,weapon) Cartoons(title,year,length,genre) Cartoon-Murd

47、erMysteries(title,year,length,genre,weapon) Movies("title","year",length,genre) MurderMysteries("title","year",length,genre,weapon) Cartoons("title","year",length,genre) Cartoon-MurderMysteries("title","year",length,genre,weapon) c) Customers(ssNo,name,phone,address) Accounts(number,balance,t

48、ype) Owns(custSSNo,accountNumber) Customers("ssNo",name,phone,address) Accounts("number",balance,type) Owns("custSSNo","accountNumber") d) Teams(name,captainName) Players(name,teamName) Fans(name,favoriteColor) Colors(colorname) For Displays association, TeamColors(teamName,colorname) Ro

49、otsFor(fanName,teamName) Admires(fanName,playerName) Teams("name",captainName) Players("name",teamName) Fans("name",favoriteColor) Colors("colorname") For Displays association, TeamColors("teamName","colorname") RootsFor("fanName","teamName") Admires("fanName","playerName") e) People(ssNo

50、name,fatherSSNo,motherSSNo) People("ssNo",name,fatherssNo,motherssNo) f) Students(email,name) Courses(no,section,semester,professorEmail) Departments(name) Professors(email,name,worksDeptName) Takes(letterGrade,studentEmail,courseNo,courseSection,courseSemester) Students("email",name) Cour

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2025 宁波自信网络信息技术有限公司  版权所有

客服电话:0574-28810668  投诉电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服