Database Reference
In-Depth Information
The DBDL version of these tables is shown in Figure A-7.
322
Department (DepartmentCode, DepartmentName)
Course (DepartmentCode, CourseNum, CourseTitle, NumCredits)
FK DepartmentCode
→ →
Department
Prereq (DepartmentCode, CourseNum, DepartmentCode/1,
CourseNum/1)
FK DepartmentCode, CourseNum
→ →
Course
FK DepartmentCode/1, CourseNum/1
→ →
Course
FIGURE A-7
DBDL for User View 1
The result of merging these relations into the cumulative design appears in the E-R diagram shown in
Figure A-8. Notice that the Department and Course tables have been merged with the existing Department
and Course tables in the cumulative design. In the process, the attribute DepartmentName was added to the
Department table and the attributes CourseTitle and NumCredits were added to the Course table. In addition,
the attribute DepartmentCode in the Course table is a foreign key. Because the Prereq table is new, it was
added to the cumulative design in its entirety. Notice also that you do not yet have any relationships among
the entities Student, Major, Faculty, and Semester.
Student
Major
Faculty
Semester
Entities are not yet
related to any
other entity
Department
Course
CourseNum
DepartmentCode (FK)
DepartmentCode
DepartmentName
CourseTitle
NumCredits
has prereq
is prereq
Entities are connected
by more than one
relationship
Named
relationships
Prereq
CourseNum (FK)
DepartmentCode (FK)
CourseNum/1 (FK)
DepartmentCode/1 (FK)
FIGURE A-8
Cumulative design after User View 1
In Figure A-8, there are two relationships between Course and Prereq. To distinguish between them, it is
necessary to name the relationships. In the figure, the name for the first relationship is
has prereq
and the
name for the second relationship is
is prereq.
Search WWH ::




Custom Search