You are on page 1of 21

Database

Systems
Entity Relationship Diagram
ERD

Dr. Tamer Abdel Latif


Lecture 2 Outline
ERD Definition

Characteristics of ERD

Components of ERD

Full Example of ERD


An Entity-relationship Diagram (ERD)

 a data modeling technique that


graphically illustrates an information
system’s entities and the relationships
between those entities.

a conceptual and representational


model of data used to represent the
entity framework infrastructure.
Characteristics of E-R Model
• Semantic data model
• Express the logical properties of an
enterprise database
• Design tools and documentation for
database structure
• First step in design phase
Components of E-R Model
• Entity
• Attribute
• Primary Key
• Relationship
Entity
• Definition
– An object or concept
• Types
– Strong entity (parent, owner, dominant)
– Weak entity (child, dependent, or subordinate)
• Diagram Notation
– Rectangular
Strong Entity Weak
Entity
Attribute
• Properties of an entity
• Types
– Single
– Composite
– Single-valued
– Multi-valued
– Derived
 Attributes are characteristics of either
an entity, a many-to-many relationship,
or a one-to-one relationship.

Attribute
Multivalued attributes are those that
are capable of taking on more than one
value.
.
Multivalued
Attributes
 Derived attributes are attributes whose
value can be calculated from related attribute
values.
 Composite attributes are represented by
ellipses that are connected with an ellipse.
they are further divided in a tree like structure.
Every node is then connected to its attribute

Attribute

composite
Attribute

Attribute
 Key attribute represents the main
characteristic of an Entity. It is used to
represent Primary key. Ellipse with underlying
lines represent Key Attribute.

Key
Attribute
Primary Key
• Primary key
• Partial Primary key
Relationship
• Definition
– Association among entities
• Relationship types
- 1: 1
-1:N
-N:N
• Degree of a relationship
– Number of participating entities
– Types
• Unary (recursive relationship)
• Binary
• Ternary
• N-ary
Weak
Relationship Relationship
One to One Relationship

1 1
Entity Relationship Entity
One-to-many 

1 N
Entity Relationship Entity
Many-to-one

N 1
Entity Relationship Entity
Many-to-many 

N N
Entity Relationship Entity
ERD Example
• Full example will be discussed on board

You might also like