Wednesday, August 8, 2012

DBMS Korth solution


Explain the distinctions among the terms primary key, candidate key, and super key.
Answer: A superkey is a set of one or more attributes that, taken collectively, al-
lows us to identify uniquely an entity in the entity set. A superkey may contain
extraneous attributes. If K is a superkey, then so is any superset ofK.Asuperkey
for which no proper subset is also a superkey is called a candidate key .Itispos-
sible that several distinct sets of attributes could serve as candidate keys. The
primary key is one of the candidate keys that is chosen by the database designer
as the principal means of identifying entities within an entity set.
Construct an E-R diagram for a car-insurance company whose customers own
one or more cars each. Each car has associated with it zero to any number of
recorded accidents.
Answer: See Figure 2.1
Construct an E-R diagram for a hospital with a set of patients and a set of medi-

cal doctors. Associate with each patient a log of the various tests and examina-
tions conducted.
Answer: See Figure 2.2
A university registrar’s office maintains data about the following entities: (a)
courses, including number, title, credits, syllabus, and prerequisites; (b) course
offerings, including course number, year, semester, section number, instructor(s),
timings, and classroom; (c) students, including student-id, name, and program;
and (d) instructors, including identification number, name, department, and ti-
tle. Further, the enrollment of students in courses and grades awarded to stu-
dents in each course they are enrolled for must be appropriately modeled.
Construct an E-R diagram for the registrar’s office. Document all assumptions
that you make about the mapping constraints.
Answer: See Figure 2.3.

No comments:

Post a Comment