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

加入VIP,免费下载
 

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

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

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(SolutionstoExercises文档格式.docx)为本站会员(b****6)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

SolutionstoExercises文档格式.docx

1、1. The Addresses entity set is nothing but a single address, so we would prefer to make address an attribute of Customers. Were the bank to record several addresses for a customer, then it might make sense to have an Addresses entity set and make Lives-at a many-many relationship. 2. The Acct-Sets e

2、ntity set is useless. Each customer has a unique account set containing his or her accounts. However, relating customers directly to their accounts in a many-many relationship conveys the same information and eliminates the account-set concept altogether. Exercise 2.2.2: Under what circumstances (re

3、garding the unseen attributes of Studios and Presidents) would you recommend combining the two entity sets and relationship in Fig. 2.3 into a single entity set and attributes? When there is exactly one Studios and exactly one President, we can combine the two entity sets into a single entity set an

4、d the president can be one attribute of entity set Studios.Exercise 2.3.1: For your E/R diagrams of: a) Exercise 2.1.1.(i) Select and specify keys, and (ii) Indicate appropriate referential integrity constraints.P.53Keys ssNo and number are appropriate for Customers and Accounts, respectively. Also,

5、 we think it does not make sense for an account to be related to zero customers, so we should round the edge connecting Owns to Customers. It does not seem inappropriate to have a customer with 0 accounts; they might be a borrower, for example, so we put no constraint on the connection from Owns to

6、Accounts. Here is the E/R diagram, showing underlined keys and the numerocity constraint.Exercise 2.4.1: One way to represent students and the grades they get in courses is to use entity sets corresponding to students, to courses, and to “enrollments”, Enrollment entities form a “connecting” entity

7、set between students and courses and can be used to represent not only the fact that a student is taking a certain course, but the grade of the student in the course. Draw an E/R diagram for this situation, indicating weak entity sets and the keys for the entity sets. Is the grade part of the key fo

8、r enrollment? P.58Here is the E/R diagram. We have omitted attributes other than our choice for the key attributes of Students and Courses. Also omitted are names for the relationships. Attribute grade is not part of the key for Enrollments. The key for Enrollements is studID from Students and dept

9、and number from Courses.Chapter 3 The Relational Data ModelExercise 3.1.1: In Fig. 3.3 are instances of two relations that might constitute part of a banking database. Indicate the following: P.64a) The attribute of each relation.Accounts: acctNo, type, balance Customers: firstName, lastName, idNo,

10、accountb) The tuples of each relation. Accounts: (12345, savings, 12000), (23456, checking, 1000), (34567, savings, 25) (Robbie, Banks, 901-222, 12345), (Lena, Hand, 805-333, 12345), (Lena, Hand, 805-333, 23456)c) The components of one tuple from each relations. The first of the three tuples has thr

11、ee components 12345, savings, and 12000 for attributes acctNo, type, and balance of relation Accounts. The first of the three tuples has four components Robbie, Banks, 901-222, and 12345 for attributes firstName, lastName, idNo, and account of relation Customers.d) The relation schema for each relat

12、ion. The relation schema for Accounts: Accounts(acctNo, type, balance)The relation schema for Customers: Customers(firstName, lastName, idNo, account)e) The database schema. The database schema is Accounts(acctNo, type, balance), and Customers(firstName, lastName, idNo, account)f) A suitable domain

13、for each attribute.For Accounts: acctNo string;type string;balance real For Customers: firstName string; lastName string; idNo string; account stringg) Another equivalent way to present each relation. For Accounts:acctNoTypeBalance12345Savings1200034567savings2523456checking1000firstNamelastNameidNo

14、accountRobbieBanks901-222LenaHand805-333Exercise 3.1.2: How many different ways (considering orders of tuples and attributes) are there to represent a relation instance if that instance has three attributes and three tuples. tuples: 3!=6 columns: number of presentation is 6*6=36Exercise 3.2.1: Conve

15、rt the E/R diagram of Fig. 3.11 to a relational database schema. P.75Customers(ssNo, name, addr, phone)Flights(number, day, aircraft)Bookings(ssNo, number, day, row, seat)Being a weak entity set, Bookings relation has the keys for Customers and Flights and Bookings own attributes.Exercise 3.2.3: The

16、 E/R diagram of Fig. 3.12 represents ships. Ships are said to be sisters if they were designed from the same plans. Convert this diagram to a relational database schema.Ships(name, yearLaunched)SisterOf(name, sister_name)Exercise 3.3.1: convert the diagram of Fig. 3.14 to relational database schema,

17、 using each of the following approaches: P.80 a) The straight-E/R method. b) The object-oriented method. c) The nulls method.Since Courses is weak, its key is number and the name of its department. We do not have a relation for GivenBy. In part (a), there is a relation for Courses and a relation for

18、 LabCourses that has only the key and the computer-allocation attribute. It looks like: Depts(name, chair) Courses(number, deptName, room) LabCourses(number, deptName, allocation)For part (b), LabCourses gets all the attributes of Courses, as: LabCourses(number, deptName, room, allocation)And for (c

19、), Courses and LabCourses are combined, as: Courses(number, deptName, room, allocation)Exercise 3.4.2: Consider a relation representing the present position of molecules in a closed container. The attributes are an ID for the molecule, the x, y, and z coordinates of the molecule, and its velocity in

20、 the x, y, and z dimensions. What FDs would you expect to hold? What are the keys? P.89 Surely ID is a key by itself. However, we think that the attributes x, y, and z together form another key. The reason is that at no time can two molecules occupy the same point. ID x y z ID vx, vy, vz x y z vx, v

21、y, vzExercise 3.4.4: In your database schema constructed for Exercise 3.2.1, indicate the keys you would expect for each relation.The key attributes are indicated by capitalization in the schema below: Customers(SSNO, name, address, phone) Flights(NUMBER, DAY, aircraft) Bookings(SSNO, NUMBER, DAY, r

22、ow, seat)Exercise 3.5.1: consider a relation with schema R(A, B, C, D) and FDs AB C, C D, and D A. P.100a) What are all the nontrivial FDs that follow from the given FDs? You should restrict yourself to FDs with single attributes on the right side.b) What are all the keys of R?c) What are all the su

23、perkey for R that are not keys?For (a), We 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. T

24、hus, the only new dependency we get with a single attribute on the left is C-A. Now consider pairs of attributes:AB+ = ABCD, so we get new dependency AB-D. AC+ = ACD, and AC-D is nontrivial. AD+ = AD, so nothing new. BC+ = ABCD, so we get BC-A, and BC-D. BD+ = ABCD, giving us BD-A and BD-C. CD+ = AC

25、D, giving CD-For the triples of attributes, ACD+ = ACD, but the closures of the other sets are each ABCD. Thus, we get new dependencies ABC-D, ABD-C, and BCD-Since ABCD+ = ABCD, we get no new dependencies. The collection of 11 new dependencies mentioned above is: C-A, AB-D, AC-D, BC-A, BC-D, BD-A, BD-C, CD-A, ABC-For (b), From 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.For (c), The superkeys are all those that contain one of those thre

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

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