资源目录
压缩包内文档预览:
编号:211097282
类型:共享资源
大小:12.43MB
格式:ZIP
上传时间:2022-05-05
上传人:考****
认证信息
个人认证
武**(实名认证)
山西
IP属地:山西
30
积分
- 关 键 词:
-
数据库系统概念第六版
数据库
系统
概念
第六
配套
课后
习题
答案
- 资源描述:
-
《数据库系统概念第六版》配套课后习题答案,数据库系统概念第六版,数据库,系统,概念,第六,配套,课后,习题,答案
- 内容简介:
-
CHAPTER2Introduction to the RelationalModelPractice Exercises2.1Consider the relational database of Figure ?. What are the appropriateprimary keys?Answer: The answer is shown in Figure 2.1, with primary keys under-lined.2.2Consider the foreign key constraint from the dept name attribute of in-structortothedepartmentrelation.Giveexamplesofinsertsanddeletestotheserelations,whichcancauseaviolationoftheforeignkeyconstraint.Answer:Inserting a tuple:(10111, Ostrom, Economics, 110,000)intotheinstructortable,wherethedepartmenttabledoesnothavethedepartment Economics, would violate the foreign key constraint.Deleting the tuple:(Biology, Watson, 90000)from the department table, where at least one student or instructortuple has dept name as Biology, would violate the foreign key con-straint.employee (person name, street, city)works (person name, company name, salary)company (company name, city)Figure 2.1Relational database for Practice Exercise 2.1.12Chapter 2Introduction to the Relational Model2.3Consider the time slot relation. Given that a particular time slot can meetmore than once in a week, explain why day and start time are part of theprimary key of this relation, while end time is not.Answer:The attributes day and start time are part of the primary keysince a particular class will most likely meet on several different days,and may even meet more than once in a day. However, end time is notpart of the primary key since a particular class that starts at a particulartime on a particular day cannot end at more than one time.2.4In the instance of instructor shown in Figure ?, no two instructors havethe same name. From this, can we conclude that name can be used as asuperkey (or primary key) of instructor?Answer: No. For this possible instance of the instructor table the namesare unique, but in general this may not be always the case (unless theuniversity has a rule that two instructors cannot have the same name,which is a rather unlikey scenario).2.5What is the result of first performing the cross product of student andadvisor, and then performing a selection operation on the result with thepredicate s id =ID? (Using the symbolic notation of relational algebra,this query can be written as ss id=ID(student advisor).)Answer:The result attributes include all attribute values of studentfollowed by all attributes of advisor. The tuples in the result are asfollows. For each student who has an advisor, the result has a rowcontainingthatstudentsattributes,followedbyans idattributeidenticalto the studentsIDattribute, followed by the i id attribute containing theIDof the students advisor.Students who do not have an advisor will not appear in the result. Astudent who has more than one advisor will appear a correspondingnumber of times in the result.2.6Consider the following expressions, which use the result of a relationalalgebraoperationastheinputtoanotheroperation.Foreachexpression,explain in words what the expression does.a.syear2009(takes) 1 studentb.syear2009(takes 1 student)c.5ID,name,course id(student 1 takes)Answer:a.For each student who takes at least one course in 2009, displaythe students information along with the information about whatcourses the student took. The attributes in the result are:ID, name, dept name, tot cred, course id, section id, semester, year, gradeb.Same as (a); selection can be done before the join operation.c.Provide a list of consisting ofExercises3ID, name, course idof all students who took any course in the university.2.7Consider the relational database of Figure ?. Give an expression in therelational algebra to express each of the following queries:a.Find the names of all employees who live in city “Miami”.b.Find the names of all employees whose salary is greater than$100,000.c.Find the names of all employees who live in “Miami” and whosesalary is greater than $100,000.Answer:a.5name(scity =“Miami”(employee)b.5name(ssalary 100000(employee)c.5name(scity =“Miami”salary100000(employee)2.8Consider the bank database of Figure ?. Give an expression in therelational algebra for each of the following queries.a.Find the
- 温馨提示:
1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
2: 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
3.本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

人人文库网所有资源均是用户自行上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作他用。