数据库系统基础教程第四章答案 下载本文

内容发布更新时间 : 2024/5/18 4:16:59星期一 下面是文章的全部内容请认真阅读。

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 and 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,flightDay,row,seat,custSSNo)

However custSSNo is no longer a key of Bookings relation. It becomes 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,movieYear,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)

Departments(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(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)