Professional Documents
Culture Documents
Introduction
Concepts of the ER Model
Structural Constraints
Problems with ER Models
Enhanced Entity Relationship Modeling
Introduction
high-level conceptual data model to facilitate
high- used to describe data in external level.
database design.
independent of the particular DBMS & hardware
developed by Peter Chen (1976).
platform.
purpose :-:-
using UML (Unified Modeling Language) notations.
a) support a user’s perception of data.
UML à modeling language created to represent
b) to conceal the more technical aspects project areas developed using the object-
object-oriented
associated with database design. method.
c) identify the processes and constraints. extended ER Model ---->
> Enhanced Entity
d) to implement the database. Relationship Modeling (EER).
e) produce consistent and non-
non-redundancy
model.
1
Examples of Entity Types entity notation à
e.g::-
e.g
Ali,
Amin, event
Raju,
Chong
modelled as
Staff
Entity
2
Relationship Types l two is binary
Degree of a Relationship
Number of participating entities in relationship.
Relationship of degree :
l recursive relationship l three is ternary
relationship type where same entity type
participates more than once in different
roles.
AD
SA SVA
CA MVA
DA
Diagram
Representation
3
Attribute Domain Simple Attribute
“set of allowable values for one or more “attribute composed of a single component with
attributes. “
an independent existence.
existence.”
e.g.: domain for staff_no is integer range from
1 - 5000; domain for name is text 1 - 25. e.g. : sex, name, salary etc.
different attribute can share same domain. known as atomic attributes.
e.g.: name & department
domain for date_of_birth
à subdomain : day, months, year.
Derived attribute
Basic attribute
Multi--valued Attribute
Multi Single--valued Attribute
Single
“attribute that holds multiple values for each “attribute that holds a single value for each
occurrence of an entity type.”
type.” occurrence of an entity type.”
type.”
have a set of numbers with upper and lower limit. can consists of simple attribute/composite.
put in a square bracket at the end of the attribute’s e.g. : student_no, ICno, staff_no etc.
name.
e.g. :-
:- no_tel [1..3]
4
Attributes on Relationships
Student
can have attribute to describe the relationship.
studNo {PK} represented by dotted line.
Primary Key -
name Alternate Key -
icNo {AK} Composite Attribute -
Derived Attribute -
dob Multi-Valued Attribute -
address
houseNo
street
city
telNo [1..3]
course
/age
5
Semantic net of Staff Manages Branch
the most common degree for relationships is
binary. relationship type
binary relationships are generally referred to as
being:
l one
one--to
to--one (1:1)
l one
one--to
to--many (1:*)
l many
many--to
to--many (*:*)
6
Summary of multiplicity constraints
multiplicity is made up of two types of restrictions
on relationships: cardinality and participation
participation..
cardinality
l describes maximum number of possible
relationship occurrences for an entity
participating in a given relationship type.
most common degree for relationship - binary.
cardinality ratio – determine the number of
possible relationships for each participating entity.
ratio :-
:- 1:1 , 1:* & *:*
7
Semantic Net of ER Model with Fan resolve the problem by restructuring the original
Trap ER model to represent the correct association
between the entities.
8
Specialization / Generalization
Superclass Attribute Inheritance
l An entity type that includes one or more distinct l An entity in a subclass represents same ‘real
subgroupings of its occurrences. world’ object as in superclass, and may
possess subclass-
subclass-specific attributes, as well as
Subclass those associated with the superclass.
l A distinct subgrouping of occurrences of an Specialization
entity type. l Process of maximizing differences between
members of an entity by identifying their
Superclass/subclass relationship is (1:1). distinguishing characteristics.
l e.g. subclass professor has the car allowance
Superclass may contain overlapping or distinct attribute while the subclass administrator has
subclasses. bonus attribute.
Not all members of a superclass need to be a
member of a subclass.
Specialization/generalization of Staff
entity into subclasses representing
job roles
Generalization
l Process of minimizing differences between
entities by identifying their common
characteristics..
characteristics
l e.g. subclass professor & subclass
l participation constraints
subclasses and indicates whether member of a
superclass can be a member of one, or more
l disjoint constraints.
than one, subclass.
l May be disjoint or nondisjoint
nondisjoint..
Participation constraint
There are four categories of constraints of
l Determines whether every member in
specialization and generalization:
superclass must participate as a member of a
l mandatory and disjoint
subclass.
l optional and disjoint
l May be mandatory or optional
optional..
l mandatory and nondisjoint
l optional and nondisjoint.
nondisjoint.
9
DreamHome worked example - Owner
Superclass with PrivateOwner and
BusinessOwner subclasses
10