Professional Documents
Culture Documents
Unit 2 Asli
Unit 2 Asli
Entity Relationship
Model
Contents
⚫ Entity types, Entity sets, Attributes, Keys
⚫ Relationship types, Relationship sets,
roles, Structural Constraints
⚫ Strong and weak entity
⚫ E-R diagram
⚫ Relationship types of degree higher than 2
⚫ Enhanced ER model
⚫ UML (Unified Modelling Language)
E-R Model
⚫ High level conceptual data model
⚫ No implementation details
⚫ Used to communicate to non technical
users
⚫ Describes the data as entities,relationships
and attributes.
Database application - “COMPANY”
1. Company is organized into departments. Each department
has unique name, number and particular employee who manages it.
We keep track of the start date when that employee began
managing the department. A department may have several locations.
Requirements
Requirements
Requirements
Requirements
Basic Concepts
⚫ Entity:
− Thing in the real world with an independent
existence.
− e.g. A particular person, a car
A Company, a job, a university course
⚫ Attributes:
− Particular properties that describe an entity
ATOMIC
COMPOSITE ATTRIBUTE
ATTRIBUTE
SINGLE-VALUED
MNAME LNAME ATTRIBUTE
GENDER
FNAME
NAME SALARY
ENO PHONE
EMPLOYEE NO
DOB
STORED
AGE
ATTRIBUTE MULTI-VALUED
ADDRESS ATTRIBUTE
DERIVED
ATTRIBUTE
Composite Vs Atomic/Simple
Attributes
Atomic Attributes : Attributes that are not divisible.
✓ Value of composite attribute is concatenation of the
values of constituent atomic attributes
Composite Composite
Phone Address
MultiValued
✓ Uniqueness constraint
A:E P(V)
Where, ‘A’ An attribute of an entity type ‘E’.
‘V’ value set & ‘P(V)’ power set
r1
d1
e1
e2 r2 d2
e3 d3
r3
e4 RELATIONSHIPd4
SET
r4
e5 .
. .
r5
. .
. .
RELATIONSHIP .
INSTANCES .
Relationship Type, Set and
Instances
❖ Relationship Type ‘R’ among entity types E1,E2,..En
defines a set of associations among entities from
these entity types
❖ Relationship set ‘R’ is a set of relationship
instances rp where each ri (from rp) associates n
individual entities (e1,e2,…en) and each entity ej in ri
is belong to Entity type Ej, 1 ≤ j ≤ n
Relationship Degree
Relationship Constraints
Participation
Cardinality Ratio Constraints
Structural Constraints
Cardinality Ratio
E1 r1 D1
E2 r2 D2
E3 r3 .
E4 r4 .
r5
r6
Examples
Patient