Employee: Fname Minit Lname
Employee: Fname Minit Lname
Employee: Fname Minit Lname
EMPLOYEE
SALARIED_EMPLOYEE
MANAGES
BELONGS_TO
Three specializations of EMPLOYEE:
{SECRETARY, TECHNICIAN, ENGINEER}
{MANAGER}
PROJECT TRADE_UNION
© Addison Wesley Longman, Inc. 2000, Elmasri/Navathe, Fundamentals of Database Systems, Third Edition
Figure 4.2 Some instances of the specialization of EMPLOYEE into the
{SECRETARY, ENGINEER, TECHNICIAN] set of subclasses.
SECRETARY
e1
EMPLOYEE
e1
ENGINEER
2
e
2
3
e 7
TECHNICIAN
© Addison Wesley Longman, Inc. 2000, Elmasri/Navathe, Fundamentals of Database Systems, Third Edition
Figure 4.3 Examples of generalization. (a) Two entity types CAR and
TRUCK. (b) Generalizing car and TRUCK into VEHICLE.
(a)
NoOfPassengers NoOfAxles
LicensePlateNo LicensePlateNo
(b)
LicensePlateNo
VehicleId Price
VEHICLE
NoOfPassengers NoOfAxles
MaxSpeed Tonnage
CAR TRUCK
© Addison Wesley Longman, Inc. 2000, Elmasri/Navathe, Fundamentals of Database Systems, Third Edition
Figure 4.4 An attribute-defined specialization
on the JobType attribute of EMPLOYEE.
EMPLOYEE
Job Type
d
“Secretary” “Engineer”
© Addison Wesley Longman, Inc. 2000, Elmasri/Navathe, Fundamentals of Database Systems, Third Edition
Figure 4.5 Notation for specialization with
overlapping (nondisjoint) subclasses.
PartNo Description
PART
ManufactureDate SupplierName
MANUFACTURED_PART PURCHASED_PART
© Addison Wesley Longman, Inc. 2000, Elmasri/Navathe, Fundamentals of Database Systems, Third Edition
Figure 4.6 A specialization lattice with the
shared subclass ENGINEERING_MANAGER.
EMPLOYEE
SALARIED_EMPLOYEE
ENGINEERING_MANAGER
© Addison Wesley Longman, Inc. 2000, Elmasri/Navathe, Fundamentals of Database Systems, Third Edition
Sex
Name Address
Salary MajorDept
Degrees
d d
Year Degree Major
Percent Time
GRADUATE_ UNDERGRADUATE_
STUDENT STUDENT
STUDENT_
STAFF FACULTY
ASSISTANT
for a UNIVERSITY database.
DegreeProgram Class
Position Rank
d
Project Course
© Addison Wesley Longman, Inc. 2000, Elmasri/Navathe, Fundamentals of Database Systems, Third Edition
RESEARCH_ASSISTANT TEACHING_ASSISTANT
A specialization lattice (with multiple inheritance)
Figure 4.8 An illustration of how to represent the UNION of two
or more entity types/classes using the category notation. Two
categories are shown: OWNER and REGISTERED_VEHICLE.
Tonnage
VehicleId
TModel
PurchaseDate
TYear
CAddress
LienOrRegular
LicensePlateNo
COMPANY
TMake
TRUCK
CName
BAddress
REGISTERED_VEHICLE
OWNER
OWNS
BANK
U
M
N
Address
BName
CYear
PERSON
CAR
Name
CModel
SSN
VehicleId
CMake
DriverLicenseNo
CStyle
© Addison Wesley Longman, Inc. 2000, Elmasri/Navathe, Fundamentals of Database Systems, Third Edition
Figure 4.9 Total and partial categories. (a) Partial category
ACCOUNT_HOLDER that is a subset of the union of two entity types COMPANY
and PERSON. (b) Total category PROPERTY and a similar generalization.
(a)
COMPANY PERSON
C1 C2
ACCOUNT_ HAS_
HOLDER BANK
ACCT
(b
BUILDIN LO PROPERT
PROPERT BUILDIN LO
© Addison Wesley Longman, Inc. 2000, Elmasri/Navathe, Fundamentals of Database Systems, Third Edition
BDate No Street AptNo City State Zip
FName MInit LName Ssn Sex
d
Figure 4.10
FPhone FACULTY
Class
1 N
ADVISOR College Degree Year
STUDENT
M N Degrees
COMMITTEE
1 Class=5
PI GRAD_STUDENT
Title No
N
GRANT Agency
M
StDate
BELONGS M
Start U
N
1 N Time N
SUPPORT REGISTERED
CHAIRS End MINOR N
M N
1
1 INSTRUCTOR_RESEARCHER MAJOR
1 Grade M
1 TRANSCRIPT
CURRENT_SECTION N
N
TEACH
Qtr=Current Qtr
and
Year=Current Year Sec#
SECTION Year
DEPARTMENT
Qtr
N
CS
DName DPhone Office
N 1
1 1
COLLEGE CD
© Addison Wesley Longman, Inc. 2000, Elmasri/Navathe, Fundamentals of Database Systems, Third Edition
N
DC COURSE
Dean
COffice
C# CName CDesc
CName
An EER conceptual schema for a UNIVERSITY database.
Figure 4.11 The UML conceptual schema for the
COMPANY database in Figure 3.15.
© Addison Wesley Longman, Inc. 2000, Elmasri/Navathe, Fundamentals of Database Systems, Third Edition
Figure 4.12 Specialization/generalization notation in UML shown by a
class diagram corresponding to the EER diagram in Figure 4.7.
PERSON
Name
Ssn
BirthDate
Sex
Address
age
...
RESEARCH_ASSISTANT TEACHING_ASSISTANT
Project Course
change_project assign_to_course
... ...
© Addison Wesley Longman, Inc. 2000, Elmasri/Navathe, Fundamentals of Database Systems, Third Edition
Figure 4.13 An illustration of ternary relationship types. (a) The ternary
relationship type SUPPLY. (b) Three binary relationship types that are not equivalent
to the ternary relationship type SUPPLY. (c) SUPPLY represented as a weak entity type.
PROJECT
ProjName
PROJECT
ProjName
ProjName
PROJECT
USES
SPJ
Quantity
SUPPLY
Quantity
PART
SUPPLIES
SP
PART
SUPPLY
PART
PartNo
vj9/2/93 bri
BJNAV2 F0316 WF 7/20/93
PartNo
PartNo
SS
CAN_SUPPLY
SUPPLIER
SUPPLIER
SUPPLIER
SName
SName
SName
(a)
(b)
(c)
© Addison Wesley Longman, Inc. 2000, Elmasri/Navathe, Fundamentals of Database Systems, Third Edition
Figure 4.14 Another example of ternary versus binary relationship types.
Semester Year
TAUGHT_DURING
IName
Sem_Year
CAN_TEACH OFFERED_DURING
CNumber
COURSE
© Addison Wesley Longman, Inc. 2000, Elmasri/Navathe, Fundamentals of Database Systems, Third Edition
Figure 4.15 A weak entity type INTERVIEW,
with a ternary identifying relationship type.
Name CName
Department Date
Dept/Date
© Addison Wesley Longman, Inc. 2000, Elmasri/Navathe, Fundamentals of Database Systems, Third Edition
Figure 4.16 An illustration of aggregation. (a) The INTERVIEW relationship type. (b)
Including JOB_OFFER in a ternary relationship type (incorrect). (c) Including JOB_OFFER
by having a relationship in which another relationship participates (generally not
allowed in ER). (d) Using aggregation and a composite (molecular) object (generally not
allowed in ER). (e) Correct representation in ER.
Phon
JOB_OFFER
JOB_APPLICA
JOB_APPLICA
JOB_APPLICA
JOB_APPLICANT
Addre
Phone
Nam
JOB_APPLICANT
Address
RESULTS_IN
Ss
Name
Dat
ContactPho
INTERVIE
Ssn
RESULTS
INTERVIE
JOB_OFF
JOB_OFFER
INTERVIE
INTERVIEW
RESULTS
JOB_OFF
INTERVIEW
ContactNa
CJI
ContactPhone
CAddress
ContactName
CAddre
Date
COMPA
COMPA
COMPANY
COMPANY
COMPA
CName
CNa
(b)
(d)
(a)
(c)
(e)
© Addison Wesley Longman, Inc. 2000, Elmasri/Navathe, Fundamentals of Database Systems, Third Edition
Figure 4.17 EER schema for a SMALL AIRPORT database.
Salary Shift
M N
WORKS_ON
Capacity
EMPLOYEE
Model Weight
N
PLANE_TYPE
MAINTAIN
M N
FLIES M
Lic_Num Restr
1
Date Workcode
OF_TYPE PILOT
Hours
Date/Workcode
N
SERVICE
Reg#
N
1
AIRPLANE PLANE_SERVICE
OWNER
N
Pdate
STORED_IN
M OWNS N
1
U
HANGAR
CORPORATION PERSON
Number Location
Ssn Name
Name Address Phone
Capacity
Address
Phone
© Addison Wesley Longman, Inc. 2000, Elmasri/Navathe, Fundamentals of Database Systems, Third Edition