0% found this document useful (0 votes)
60 views17 pages

Employee: Fname Minit Lname

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 17

Figure 4.

1 EER diagram notation for representing


specialization and subclasses.
FName MInit LName

Name Ssn BirthDate Address

EMPLOYEE

TypingSpeed TGrade EngType


PayScale

SECRETARY TECHNICIAN ENGINEER MANAGER Salary


HOURLY_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

Price Price Tonnage


MaxSpeed
CAR TRUCK
VehicleId VehicleId

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.

FName MInit LName

Name Ssn BirthDate Address JobType

EMPLOYEE

Job Type

d
“Secretary” “Engineer”

TypingSpeed TGrade EngType


“Technician”

SECRETARY TECHNICIAN 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

DrawingNo BatchNo ListPrice

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

SECRETARY TECHNICIAN ENGINEER MANAGER


HOURLY_EMPLOYEE

SALARIED_EMPLOYEE

ENGINEERING_MANAGER

© Addison Wesley Longman, Inc. 2000, Elmasri/Navathe, Fundamentals of Database Systems, Third Edition
Sex
Name Address

SSN PERSON BirthDate


Figure 4.7

Salary MajorDept

EMPLOYEE ALUMNUS STUDENT

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

Name PERSON Address

d
Figure 4.10

FOffice Rank Salary

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.

EMPLOYEES DEPARTMENT Multiplicity Notation in OMT:


4..* WORKS_FOR 1..1 1..1
Name: NameDom Name
Fname Number 0..*
1..1 0..1
Minit add_employee
Lname 0..1
number_of_employees
Ssn change_manager
MANAGES 0..*
Bdate:Date ...
Sex:{M,F} StartDate
Address
1..* 1..1
Salary
1..*
age
change_department * WORKS ON LOCATION
change_projects CONTROLS
supervisee Hours Name
...
1..* 1..1
Dependent Name
*
0..1
supervisor PROJECT 0..*
Name
Number
DEPENDENT add_employee
Sex:{M,F} add_project Aggregation Notation in UML:
BirthDate: Date change_manager
Relationship ... PART
WHOLE
...

© 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
...

EMPLOYEE ALUMNUS DEGREE STUDENT


Salary Year MajorDept
1 * Degree
hire_emp new_alumnus Major change_major
... ... ... ...

STAFF FACULTY STUDENT_ASSISTANT GRADUATE_STUDENT UNDERGRADUATE_STUDENT


Position Rank PercentTime DegreeProgram Class
hire_staff promote hire_student change_degree_program change_classification
... ... ... ... ...

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

INSTRUCTOR OFFERS SEMESTER

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

CANDIDATE CCI COMPANY

Department Date

Dept/Date

INTERVIEW RESULTS_IN JOB_OFFER

© 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

You might also like