Database Reference
In-Depth Information
Figure 3.7
STUDENT table design in Windows Azure SQL Database.
3.4.2 Representing Relationships
Chapter 2 described some commonly used relationships: identifying relationship, nonidentifying
relationship, nonspeciic relationship, categorization relationship, recursive relationship, and ternary
relationship. As entities are represented by relations, the relationship between two relations will be
represented by a shared column. hat is, the primary key of one relation is shared by another relation
as a foreign key. he following shows how to represent each type of relationship by sharing the key:
1. Identifying relationship : In Chapter 2, we discussed the identifying relationship between the
entities CLASSROOM and BUILDING. he relationship between these two entities is
shown in Figure 3.8.
In the above identifying relationship, the entity BUILDING is the parent and the entity
CLASSROOM is the child. he identifying relationship can be represented by letting both
the parent relation BUILDING and the child relation CLASSROOM share the column
BuildingId. BuildingId is the primary key in the parent relation BUILDING and is the
foreign key and part of the combination primary key in the child relation CLASSROOM.
he relation notation representing the identifying relationship is shown below:
BUILDING( BuildingId , BuildingName)
CLASSROOM( ClassroomId , BuildingId , Capacity)
CLASSROOM
BUILDING
BuildingID
ClassroomID
BuildingId (FK)
P
BuildingName
Capacity
Figure 3.8
Identifying relationship.
Search WWH ::




Custom Search