Database Reference
In-Depth Information
STUDENT
FACULT Y
StudentID
FacultyID
FirstName
FirstName
LastName
LastName
Major
Department
FacultyID (FK)
Figure 2.7
Nonidentifying relationship with optional parent.
where N can be zero, one, or many. In our example, the FACULTY entity is on the 1 side of the
relationship and the STUDENT entity is on the N side of the relationship.
Nonspeciic relationship : From the requirement analysis, we have learned that a student can
take several classes and a class should have at least 10 students. his is a many-to-many ( M : N ) rela-
tionship. Since such a relationship does not have a direction from a parent entity to a child entity,
it is called a nonspeciic relationship . Physically, you cannot directly place a key value such as
an ID of one entity to the other entity as the foreign key like what we did in a 1: N relationship. If
you do so, several IDs from the irst entity placed in the second entity will relate to the same ID
in the second entity. his behavior forces the second entity to generate nonunique ID values. he
same is true if several IDs from the second entity are placed in the irst entity. To overcome this
diiculty, a nonspeciic relationship is often represented by two 1: N relationships that will relate
the two entities with an intersection entity as shown in Figure 2.8.
As seen in Figure 2.8, a new entity STUDENT_CLASS is added to connect the entity
STUDENT and the entity CLASS. he intersection entity STUDENT_CLASS contains the
keys from both entities involved in the nonspeciic relationship. It is required that all the key
attributes are not null. We will further discuss the M : N relationship when we get to the physical
implementation of a database.
Categorization relationship : Categorization relationship is used to represent a relationship
between a super type (also called generic ) entity and a group of subtype (also called speciic )
entities. In our requirement analysis, we did not ind this type of relationship. But, we can use
another example. Consider the entity FACULTY that includes professors and instructors who
have some unshared attributes such as Rank, which only applies to a full-time professor. If we
place all the unshared instances in the FACULTY entity, the unshared attributes will contain
a large number of null values. For example, if the Rank attribute is included in the FACULTY
entity, all the corresponding Rank values for instructors will be NULL. To avoid this problem, we
can place the shared attributes in the generic entity FACULTY and the unshared attributes in the
CLASS
ClassID
STUDENT
STUDENT_CLASS
StudentID
10-30
StudentID (FK)
ClassID (FK)
CourseName
Time
Semester
Classroom
Instructor
Firstname
Lastname
Major
0-7
Grade
Figure 2.8
Nonspeciic relationship with intersection entity.
 
Search WWH ::




Custom Search