Er Modeling: Csc271 - Database Systems
Er Modeling: Csc271 - Database Systems
LECTURE - 06
ER MODELING
Today’s Lecture
ssn lot
since Employees
name dname
super- subor-
ssn lot did budget visor dinate
Reports_To
Employees Works_In Departments
Relationship type
Relationship instances
ER Model – Degree of Relationships
Unary Relationship
Binary Relationship
Ternary Relationship
5
Entities of
One entity two different
related to types related Entities of three
another of to each other different types
the same
related to each
entity type
other
ER Model – Unary Relationships
UNARY RELATIONSHIP
ER Model – Binary Relationships
BINARY RELATIONSHIP
ER Model – Ternary Relationships
ER Model – Connectivity of Relationships
• Cardinality limits are usually derived from the organization's policies or external
constraints.
• Minimum cardinality
• Maximum cardinality
• Represented as o or |
ER Model : Cardinality - Example
a video store may stock more than one VIDEOTAPE for each MOVIE, this is a ‘one-to-
many’ relationship as in the following Fig.
MINIMUM CARDINALITY
Is the maximum number of instances of an entity B that may be associated with each
instance of entity A
In the following Fig., the maximum cardinality for the VIDEOTAPE entity type is
‘many’ (an unspecified number greater than 1)
This is indicated by the ‘crow’s foot’ symbol on the arrow next to the VIDEOTAPE
entity symbol
Relationship with cardinality constraints
EXAMPLE OF MANDATORY CARDINALITY CONSTRAINTS
Each PATIENT has one or more PATIENT_HISTORIES (the initial patient visit is always
recorded as an instance of PATIENT_HISTORY)
Each instance of PATIENT_HISTORY ‘Belongs to’ exactly one PATIENT (see following
Fig.)
Mandatory cardinalities
Optional cardinalities
person is is
married to at most
ne other person, or
may not be married
t all
ER Model - Identifiers
The identifier is
composed of two subparts
ER Model – Identifier Characteristics
A company has several departments. Each department has a supervisor and at least one
employee. Employees must be assigned to at least one, but possibly more departments.
At least one employee is assigned to a project, but an employee may be on vacation and
not assigned to any projects. The important data fields are the names of the departments,
projects, supervisors and employees, as well as the supervisor and employee number
and a unique project number.
http://www.thomasformo.com/category/qa/