0% found this document useful (0 votes)
38 views

Er Modeling: Csc271 - Database Systems

This document provides an overview of entity-relationship (ER) modeling concepts including relationships, cardinality, and identifiers. Relationships can be unary, binary, or ternary based on the number of entity types involved. Cardinality specifies the minimum and maximum number of relationship instances allowed between entities. Identifiers uniquely identify entity instances and should be non-changing attributes. The document uses examples to illustrate key ER modeling concepts.

Uploaded by

UmER KhAN
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views

Er Modeling: Csc271 - Database Systems

This document provides an overview of entity-relationship (ER) modeling concepts including relationships, cardinality, and identifiers. Relationships can be unary, binary, or ternary based on the number of entity types involved. Cardinality specifies the minimum and maximum number of relationship instances allowed between entities. Identifiers uniquely identify entity instances and should be non-changing attributes. The document uses examples to illustrate key ER modeling concepts.

Uploaded by

UmER KhAN
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 27

CSC271 – DATABASE SYSTEMS

LECTURE - 06

ER MODELING
Today’s Lecture

In this lecture, you will learn the following aspects of ER Model:


 Relationships
 Cardinality
 Identifiers
ER Model - Relationships
name

ssn lot

since Employees
name dname
super- subor-
ssn lot did budget visor dinate
Reports_To
Employees Works_In Departments

 Relationship instance – link between entities (corresponds to primary key-foreign key


equivalencies in related tables)

 Relationship type – category of relationship…link between entity types


ER Model – Relationship Types vs Instances

Relationship type

Relationship instances
ER Model – Degree of Relationships

Degree of a relationship is the number of entity types that participate in it

 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

Connectivity shows the type of relationship as follows:


• One-One relationship (1-1)
• One-Many relationship (1-M)
• Many-Many relationship (M-N)
ER Model : One-One & One-Many Relationships
ER Model : Many-One & Many-Many Relationships
ER Model – Cardinality of Relationships

The cardinality of a relationship is the number of instances of entity B that can be


associated with entity A.

• 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

 The minimum cardinality of a relationship is the minimum number of instances of an


entity B that may be associated with each instance of an entity A
 In our example, the minimum number of VIDEOTAPES of a MOVIE is zero (entity
B is an optional participant in the ‘Is_Stocked_As’ relationship)
 This is signified by the symbol zero through the arrow near the VIDEOTAPE entity
MAXIMUM 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

 Identifier (Key) - An attribute (or combination of attributes) that uniquely


identifies individual instances of an entity type

 Simple identifier versus Composite identifier

 Candidate identifier – an attribute that could be an identifier … satisfies the


requirements for being an identifier
Simple identifier

The identifier is underlined


Composite identifier

The identifier is
composed of two subparts
ER Model – Identifier Characteristics

 Will not change in value

 Will not be null

 No intelligent identifiers (e.g. containing locations or people that might change)


ER ACTIVITY

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/

You might also like