Documente Academic
Documente Profesional
Documente Cultură
Slide 9- 1
Chapter Outline
Slide 9- 2
Slide 9- 3
SSN, DNUMBER, and PNUMBER are the primary keys for the
relations EMPLOYEE, DEPARTMENT, and PROJECT as shown.
Slide 9- 4
E(ssn,bd,fn,mi,ln)
D(n,n)
P(n,n)
loc(1,n,n)
Copyright 2016 Ramez Elmasri and Shamkant B. Navathe
Slide 9- 6
For each weak entity type W in the ER schema with owner entity type E,
create a relation R & include all simple attributes (or simple components of
composite attributes) of W as attributes of R.
Include the primary key SSN of the EMPLOYEE relation as a foreign key
attribute of DEPENDENT (renamed to ESSN).
Slide 9- 6
identify the relations S and T that correspond to the entity types participating in R.
Slide 9- 7
identify the relation S that represent the participating entity type at the N-side
of the relationship type.
Slide 9- 8
Include as foreign key attributes in S the primary keys of the relations that represent
the participating entity types; their combination will form the primary key of S.
Also include any simple attributes of the M:N relationship type (or simple components
of composite attributes) as attributes of S.
The primary keys of the PROJECT and EMPLOYEE relations are included as foreign
keys in WORKS_ON and renamed PNO and ESSN, respectively.
Attribute HOURS in WORKS_ON represents the HOURS attribute of the relation type.
The primary key of the WORKS_ON relation is the combination of the foreign key
attributes {ESSN, PNO}.
Slide 9- 9
Slide 9- 10
Also include any simple attributes of the n-ary relationship type (or
simple components of composite attributes) as attributes of S.
Slide 9- 11
Slide 9- 13
FIGURE 3.17
Slide 9- 13
Slide 9- 14
Slide 9- 15
Slide 9- 16
E.g., we have Person entity, with overlap: Employee and Student Subclasses
Slide 9- 17
Slide 9- 18
Slide 9- 19
FIGURE 4.4
EER diagram notation for an attribute-defined
specialization on JobType.
Slide 9- 20
10
Slide 9- 21
Slide 9- 22
11
Slide 9- 23
Slide 9- 24
12
FIGURE 4.5
An overlapping (non-disjoint) specialization.
Slide 9- 25
Slide 9- 26
13
(a) Mapping the EER schema in Figure 4.4 using option 8A.
(b) Mapping the EER schema in Figure 4.3(b) using option 8B.
(c) Mapping the EER schema in Figure 4.4 using option 8C.
(d) Mapping Figure 4.5 using option 8D with Boolean type fields Mflag and Pflag.
Copyright 2016 Ramez Elmasri and Shamkant B. Navathe
Slide 9- 29
Slide 9- 28
14
FIGURE 4.7
Slide 9- 29
FIGURE 9.6
Mapping the EER specialization lattice in Figure 4.7 using
multiple options.
Slide 9- 30
15
The primary key of the OWNER relation is the surrogate key, which
we called OwnerId.
Slide 9- 31
FIGURE 4.8
Slide 9- 32
16
FIGURE 9.7
Mapping the EER categories (union types) in Figure 4.8 to
relations.
Slide 9- 33
Chapter Summary
Slide 9- 34
17