Professional Documents
Culture Documents
Session 07 (Extended / Enhanced) Entity Relationship Modelling
Session 07 (Extended / Enhanced) Entity Relationship Modelling
Session 07 (Extended / Enhanced) Entity Relationship Modelling
(Extended / Enhanced )
Entity Relationship Modelling
Entity Relationship Model
Specialisation-
SuperClass & SubClass
Attribute Inheritance
Generalisation
Categorisation
Aggregation
Specialisation
Staff(staff_no,name,address,dob)
Manager (Role)
Secretary(w_skills)
Sales_personnel (sales_area, car_allowance)
Specialisation cont...
given family
name studno
STUDENT
tutor m
undergraduate postgraduate
thesis title
Superclasses, Subclasses
Specialisation & Generalisation Relationships
payroll no name
STAFF
length of service
Partial Participation
with Overlap
O
level grade
project
Superclasses, Subclasses
Specialisation & Generalisation Relationships
name PERSON
address
O
Overlap
salary
fee
EMPLOYEE STUDENT
Overlap Disjoint
O d
thesis
RESEARCH TEACHING
POST UNDER
1-2 GRAD GRAD
O
COMPANY
PERSON
personid compid
U
duration of ownership
OWNER
Specialisation & Generalisation Option A
1. Create a relation for superclass
2. Create a relation for each subclass such that:
{primary_key of superclass} U {attributes of subclass}
3. key for subclass is (primary_key of superclass)
given family
name studno
STUDENT
d
year
undergraduate postgraduate
thesis title
Specialisation & Generalisation Option B
1. Create a relation for each subclass such that:
{primary_key U {attributes U {attributes of
of superclass} of superclass} subclass}
key for each relation is (primary_key of superclass)
given family
name studno
STUDENT
d
year
undergraduate postgraduate
thesis title
Specialisation & Generalisation Option C
1. Create one relation such that:
{primary_key U {attributes U {attributes U {type
of superclass} of superclass} of all subclasses} attribute}
key for subclass is (primary_key of superclass)
given family
name studno
STUDENT
Disjoint d
year
undergraduate postgraduate
thesis title
Specialisation & Generalisation Overlapping
1.STAFF(payrollno,name,lengthofservice)
ACADEMIC(payrollno,level)
payroll no name
STAFF TECHNICAL(payrollno,project)
ADMIN(payrollno,grade)
length of service
2.ACADEMIC(payrollno,name,lengthofservice,
O level)
TECHNICAL(payrollno,name,lengthofservice,
level project)
grade
ADMIN(payrollno,name,lengthofservice,grade)
ACADEMIC TECHNICAL ADMIN 3.STAFF(payrollno,name,lengthofservice,level,
project,grade,type1,type2,type3)
project STAFF(payrollno,name,lengthofservice,level,
project,grade,type)
type = powerset of classes
Specialisation & Generalisation Relationships
name PERSON
address
O
salary
fee
EMPLOYEE STUDENT
O
d
thesis
RESEARCH TEACHING
POST UNDER
1-2 GRAD GRAD
O
year = 3
TUTORS 1-2
LECTURING SUPERVISOR FINAL
YEAR
courseno project
Specialisation with Shared Subclass
To be a shared subclass the superclasses must
have the same key.
payroll no Staff
d
d
Manager Hourly Staff
Salaried Staff
Academic Technical Admin
Admin Manager
Categories and Categorisation
A category is a subclass of the union of two or more
superclasses that can have different keys because they
can be of different entity types
If defining superclasses have different keys, specify a
new surrogate key
COMPANY
PERSON
personid compid
U
duration of ownership
OWNER
Next Session