SlideShare a Scribd company logo
Entity Relationship Diagram
(ERD)
Objectives
• Define terms related to entity relationship
modeling, including entity, entity instance,
attribute, relationship and cardinality, and
primary key.
• Describe the entity modeling process.
• Discuss how to draw an entity relationship
diagram.
• Describe how to recognize entities,
attributes, relationships, and cardinalities.
Database Model
A database can be modeled as:
– a collection of entities,
– relationship among entities.
Database systems are often modeled using
an Entity Relationship (ER) diagram as the
"blueprint" from which the actual data is
stored — the output of the design phase.
Entity Relationship Diagram (ERD)
• ER model allows us to sketch database designs
• ERD is a graphical tool for modeling data.
• ERD is widely used in database design
• ERD is a graphical representation of the logical
structure of a database
• ERD is a model that identifies the concepts or
entities that exist in a system and the
relationships between those entities
Purposes of ERD
An ERD serves several purposes
• The database analyst/designer gains a
better understanding of the information to
be contained in the database through the
process of constructing the ERD.
• The ERD serves as a documentation tool.
• Finally, the ERD is used to communicate
the logical structure of the database to
users. In particular, the ERD effectively
communicates the logic of the database to
users.
Components of an ERD
An ERD typically consists of four different
graphical components:
1. Entity
2. Relationship
3. Cardinality
4. Attribute
Classification of Relationship
• Optional Relationship
– An Employee may or may not be assigned
to a Department
– A Patient may or may not be assigned to a
Bed
• Mandatory Relationship
– Every Course must be taught by at least
one Teacher
– Every mother have at least a Child
Cardinality Constraints
 Express the number of entities to which another
entity can be associated via a relationship set.
• Cardinality Constraints - the number of instances
of one entity that can or must be associated with
each instance of another entity.
• Minimum Cardinality
– If zero, then optional
– If one or more, then mandatory
• Maximum Cardinality
– The maximum number
Cardinality Constraints (Contd.)
• For a binary relationship set the mapping
cardinality must be one of the following types:
–One to one
• A Manager Head one Department and vice versa
–One to many ( or many to one)
• An Employee Works in one Department or One
Department has many Employees
–Many to many
• A Teacher Teaches many Students and A student
is taught by many Teachers
Cardinality Constraints (Contd.)
Cardinality Constraints Example
• In our model, we wish to indicate that each
school may enroll many students, or may not
enroll any students at all.
• We also wish to indicate that each student
attends exactly one school. The following
diagram indicates this optionality and
cardinality:
Cardinality Constraints Example (Contd.)
SCHOOL
STUDENT
Each school enrolls
at least zero
and at most many
students
Each student attends
at least one
and at most one
school
General Steps to create an ERD
• Identify the entity
• Identify the entity's attributes
• Identify the Primary Keys
• Identify the relation between entities
• Identify the Cardinality constraint
• Draw the ERD
• Check the ERD
Steps in building an ERD
Developing an ERD
The process has ten steps:
1. Identify Entities
2. Find Relationships
3. Draw Rough ERD
4. Fill in Cardinality
5. Define Primary Keys
6. Draw Key-Based ERD
7. Identify Attributes
8. Map Attributes
9. Draw fully attributed ERD
10. Check Results
A Simple Example
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.
Identify entities
• One approach to this is to work through the
information and highlight those words which you think
correspond to entities.
• 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.
• A true entity should have more than one instance
Find Relationships
• Aim is to identify the associations, the
connections between pairs of entities.
• A simple approach to do this is using a
relationship matrix (table) that has rows and
columns for each of the identified entities.
Find Relationships (Contd.)
• Go through each cell and decide whether or not
there is an association. For example, the first cell
on the second row is used to indicate if there is a
relationship between the entity "Employee" and
the entity "Department".
Identified Relationships
Names placed in the cells are meant to
capture/describe the relationships. So you
can use them like this
• A Department is assigned an employee
• A Department is run by a supervisor
• An employee belongs to a department
• An employee works on a project
• A supervisor runs a department
• A project uses an employee
Draw Rough ERD
Draw a diagram and:
• Place all the entities in rectangles
• Use diamonds and lines to represent the
relationships between entities.
• General Examples
Drawing Rough ERD (Contd.)
Drawing Rough ERD (Contd.)
Drawing Rough ERD (Contd.)
Fill in Cardinality
• Supervisor
– Each department has one supervisor.
• Department
– Each supervisor has one department.
– Each employee can belong to one or more departments
• Employee
– Each department must have one or more employees
– Each project must have one or more employees
• Project
– Each employee can have 0 or more projects.
Fill in Cardinality (Contd.)
The cardinality of a relationship can only
have the following values
–One and only one
–One or more
–Zero or more
–Zero or one
Cardinality Notation
Cardinality Examples
A
A
A
A
B
B
B
B
Each instance of A is related to a minimum of
zero and a maximum of one instance of B
Each instance of B is related to a minimum of
one and a maximum of one instance of A
Each instance of A is related to a minimum of
one and a maximum of many instances of B
Each instance of B is related to a minimum of
zero and a maximum of many instances of A
ERD with cardinality
Examples
ERD for Course Enrollment
ERD for Course Registration
Rough ERD Plus Primary Keys
Identify Attributes
• In this step we try to identify and name all the attributes
essential to the system we are studying without trying to
match them to particular entities.
• The best way to do this is to study the forms, files and reports
currently kept by the users of the system and circle each data
item on the paper copy.
• Cross out those which will not be transferred to the new
system, extraneous items such as signatures, and constant
information which is the same for all instances of the form
(e.g. your company name and address). The remaining
circled items should represent the attributes you need. You
should always verify these with your system users.
(Sometimes forms or reports are out of date.)
• The only attributes indicated are the names of the
departments, projects, supervisors and employees, as well
as the supervisor and employee NUMBER and a unique
project number.
Map Attributes
• For each attribute we need to match it with exactly
one entity. Often it seems like an attribute should
go with more than one entity (e.g. Name). In this
case you need to add a modifier to the attribute
name to make it unique (e.g. Customer Name,
Employee Name, etc.) or determine which entity an
attribute "best' describes.
• If you have attributes left over without
corresponding entities, you may have missed an
entity and its corresponding relationships. Identify
these missed entities and add them to the
relationship matrix now.
Map Attributes (Contd.)
Draw Fully Attributed ERD
Check ERD Results
• Look at your diagram from the point of view of
a system owner or user. Is everything clear?
• Check through the Cardinality pairs.
• Also, look over the list of attributes associated
with each entity to see if anything has been
omitted.
Questions
• Feel Free to ask any Questions

More Related Content

PPTX
Erd examples
PPTX
Erd practice exercises
PPT
2. Entity Relationship Model in DBMS
PPTX
Entity Relationship Diagrams
PPT
Entity relationship modelling
ODP
ER Model in DBMS
PPTX
ER DIAGRAM & ER MODELING IN DBMS
PPTX
Er diagrams presentation
Erd examples
Erd practice exercises
2. Entity Relationship Model in DBMS
Entity Relationship Diagrams
Entity relationship modelling
ER Model in DBMS
ER DIAGRAM & ER MODELING IN DBMS
Er diagrams presentation

What's hot (20)

PPTX
Entity Relationship Diagram
PDF
Enhanced Entity-Relationship (EER) Modeling
PPTX
Er diagram
PPTX
ER MODEL
PPTX
Object oriented database concepts
PPTX
Entity Relationship Model
PPT
Files Vs DataBase
PPTX
ER model to Relational model mapping
PPTX
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
PPTX
Functional dependencies in Database Management System
DOCX
Chapter-3 Data Modeling Using the Entity-Relationship Model
PPT
ER Diagram
PPTX
Entity (types, attibute types)
PPT
Dbms relational model
PPTX
Mapping Cardinalities
PPTX
Relational model
PPTX
How to Draw an Effective ER diagram
PPT
Database Chapter 3
PPTX
Normalization in DBMS
Entity Relationship Diagram
Enhanced Entity-Relationship (EER) Modeling
Er diagram
ER MODEL
Object oriented database concepts
Entity Relationship Model
Files Vs DataBase
ER model to Relational model mapping
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
Functional dependencies in Database Management System
Chapter-3 Data Modeling Using the Entity-Relationship Model
ER Diagram
Entity (types, attibute types)
Dbms relational model
Mapping Cardinalities
Relational model
How to Draw an Effective ER diagram
Database Chapter 3
Normalization in DBMS
Ad

Viewers also liked (15)

PPTX
Database - Entity Relationship Diagram (ERD)
PPT
Entity Relationship Diagram
PDF
Er diagram practical examples
DOC
Steps of-creating-a-database
PPTX
Base1
PPT
Oracle Forms: Messages
PPTX
Entity Relationship Diagram presentation
PPS
Er diagram
DOC
Major project report format Saloon Application
PDF
Chapter 3 Entity Relationship Model
PDF
RDBMS ERD Examples
PPT
Entity relationship diagram (erd)
PDF
SQL Stored Procedures For My Library Project
PPT
ER DIAGRAM TO RELATIONAL SCHEMA MAPPING
PPTX
Hotel reservation system
Database - Entity Relationship Diagram (ERD)
Entity Relationship Diagram
Er diagram practical examples
Steps of-creating-a-database
Base1
Oracle Forms: Messages
Entity Relationship Diagram presentation
Er diagram
Major project report format Saloon Application
Chapter 3 Entity Relationship Model
RDBMS ERD Examples
Entity relationship diagram (erd)
SQL Stored Procedures For My Library Project
ER DIAGRAM TO RELATIONAL SCHEMA MAPPING
Hotel reservation system
Ad

Similar to Entity relationship diagram (erd) (20)

PPTX
Entity Relationship Diagram
PDF
Entity relationship diagram (erd)
PDF
Lecture 2 database management system.pdf
PPTX
ER - 04 - ERD Design Methodology DB.pptx
PPTX
E_R-Diagram (2).pptx
PPTX
IT6701 Information Management Unit-I
PPTX
Database management systems 3 - Data Modelling
PPTX
Lecture7.pptx
PPT
ermodelN in database management system.ppt
PPT
D I T211 Chapter 3
PDF
lecture2.pdf
PPTX
database_design_presentation, data base design presenttion
PPTX
Module2 Data Base Design- ER and NF.pptx
PPTX
print ERD | SQL Database Modeler
PPTX
unit 1 Entity Relationship Modelling.pptx
PPTX
Export ERD | SQL Database Modeler.pptx
PPT
Desigining of Database - ER Model
DOCX
Entity relationship diagram (erd)
PDF
ER diagram
PPTX
Use analyzed requirements in the design of database.pptx
Entity Relationship Diagram
Entity relationship diagram (erd)
Lecture 2 database management system.pdf
ER - 04 - ERD Design Methodology DB.pptx
E_R-Diagram (2).pptx
IT6701 Information Management Unit-I
Database management systems 3 - Data Modelling
Lecture7.pptx
ermodelN in database management system.ppt
D I T211 Chapter 3
lecture2.pdf
database_design_presentation, data base design presenttion
Module2 Data Base Design- ER and NF.pptx
print ERD | SQL Database Modeler
unit 1 Entity Relationship Modelling.pptx
Export ERD | SQL Database Modeler.pptx
Desigining of Database - ER Model
Entity relationship diagram (erd)
ER diagram
Use analyzed requirements in the design of database.pptx

More from tameemyousaf (11)

PPT
Entity relationship diagram (erd)
PPT
IP addressing
PPT
Switching Techniques
PPT
IP addressing
PPT
Flow & Error Control
PPT
PPT
03 stacks and_queues_using_arrays
PPT
Workgroup vs domain
PPT
Windows server 2003_r2
PPT
PPT
Active directory installation windows 2003 1
Entity relationship diagram (erd)
IP addressing
Switching Techniques
IP addressing
Flow & Error Control
03 stacks and_queues_using_arrays
Workgroup vs domain
Windows server 2003_r2
Active directory installation windows 2003 1

Recently uploaded (20)

PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Spectral efficient network and resource selection model in 5G networks
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Empathic Computing: Creating Shared Understanding
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Cloud computing and distributed systems.
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Encapsulation_ Review paper, used for researhc scholars
Spectral efficient network and resource selection model in 5G networks
The AUB Centre for AI in Media Proposal.docx
Network Security Unit 5.pdf for BCA BBA.
Per capita expenditure prediction using model stacking based on satellite ima...
MYSQL Presentation for SQL database connectivity
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Chapter 3 Spatial Domain Image Processing.pdf
NewMind AI Monthly Chronicles - July 2025
Empathic Computing: Creating Shared Understanding
Reach Out and Touch Someone: Haptics and Empathic Computing
Cloud computing and distributed systems.
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Big Data Technologies - Introduction.pptx
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
NewMind AI Weekly Chronicles - August'25 Week I
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Mobile App Security Testing_ A Comprehensive Guide.pdf

Entity relationship diagram (erd)

  • 2. Objectives • Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship and cardinality, and primary key. • Describe the entity modeling process. • Discuss how to draw an entity relationship diagram. • Describe how to recognize entities, attributes, relationships, and cardinalities.
  • 3. Database Model A database can be modeled as: – a collection of entities, – relationship among entities. Database systems are often modeled using an Entity Relationship (ER) diagram as the "blueprint" from which the actual data is stored — the output of the design phase.
  • 4. Entity Relationship Diagram (ERD) • ER model allows us to sketch database designs • ERD is a graphical tool for modeling data. • ERD is widely used in database design • ERD is a graphical representation of the logical structure of a database • ERD is a model that identifies the concepts or entities that exist in a system and the relationships between those entities
  • 5. Purposes of ERD An ERD serves several purposes • The database analyst/designer gains a better understanding of the information to be contained in the database through the process of constructing the ERD. • The ERD serves as a documentation tool. • Finally, the ERD is used to communicate the logical structure of the database to users. In particular, the ERD effectively communicates the logic of the database to users.
  • 6. Components of an ERD An ERD typically consists of four different graphical components: 1. Entity 2. Relationship 3. Cardinality 4. Attribute
  • 7. Classification of Relationship • Optional Relationship – An Employee may or may not be assigned to a Department – A Patient may or may not be assigned to a Bed • Mandatory Relationship – Every Course must be taught by at least one Teacher – Every mother have at least a Child
  • 8. Cardinality Constraints  Express the number of entities to which another entity can be associated via a relationship set. • Cardinality Constraints - the number of instances of one entity that can or must be associated with each instance of another entity. • Minimum Cardinality – If zero, then optional – If one or more, then mandatory • Maximum Cardinality – The maximum number
  • 9. Cardinality Constraints (Contd.) • For a binary relationship set the mapping cardinality must be one of the following types: –One to one • A Manager Head one Department and vice versa –One to many ( or many to one) • An Employee Works in one Department or One Department has many Employees –Many to many • A Teacher Teaches many Students and A student is taught by many Teachers
  • 11. Cardinality Constraints Example • In our model, we wish to indicate that each school may enroll many students, or may not enroll any students at all. • We also wish to indicate that each student attends exactly one school. The following diagram indicates this optionality and cardinality:
  • 12. Cardinality Constraints Example (Contd.) SCHOOL STUDENT Each school enrolls at least zero and at most many students Each student attends at least one and at most one school
  • 13. General Steps to create an ERD • Identify the entity • Identify the entity's attributes • Identify the Primary Keys • Identify the relation between entities • Identify the Cardinality constraint • Draw the ERD • Check the ERD
  • 15. Developing an ERD The process has ten steps: 1. Identify Entities 2. Find Relationships 3. Draw Rough ERD 4. Fill in Cardinality 5. Define Primary Keys 6. Draw Key-Based ERD 7. Identify Attributes 8. Map Attributes 9. Draw fully attributed ERD 10. Check Results
  • 16. A Simple Example 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.
  • 17. Identify entities • One approach to this is to work through the information and highlight those words which you think correspond to entities. • 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. • A true entity should have more than one instance
  • 18. Find Relationships • Aim is to identify the associations, the connections between pairs of entities. • A simple approach to do this is using a relationship matrix (table) that has rows and columns for each of the identified entities.
  • 19. Find Relationships (Contd.) • Go through each cell and decide whether or not there is an association. For example, the first cell on the second row is used to indicate if there is a relationship between the entity "Employee" and the entity "Department".
  • 20. Identified Relationships Names placed in the cells are meant to capture/describe the relationships. So you can use them like this • A Department is assigned an employee • A Department is run by a supervisor • An employee belongs to a department • An employee works on a project • A supervisor runs a department • A project uses an employee
  • 21. Draw Rough ERD Draw a diagram and: • Place all the entities in rectangles • Use diamonds and lines to represent the relationships between entities. • General Examples
  • 22. Drawing Rough ERD (Contd.)
  • 23. Drawing Rough ERD (Contd.)
  • 24. Drawing Rough ERD (Contd.)
  • 25. Fill in Cardinality • Supervisor – Each department has one supervisor. • Department – Each supervisor has one department. – Each employee can belong to one or more departments • Employee – Each department must have one or more employees – Each project must have one or more employees • Project – Each employee can have 0 or more projects.
  • 26. Fill in Cardinality (Contd.) The cardinality of a relationship can only have the following values –One and only one –One or more –Zero or more –Zero or one
  • 28. Cardinality Examples A A A A B B B B Each instance of A is related to a minimum of zero and a maximum of one instance of B Each instance of B is related to a minimum of one and a maximum of one instance of A Each instance of A is related to a minimum of one and a maximum of many instances of B Each instance of B is related to a minimum of zero and a maximum of many instances of A
  • 31. ERD for Course Enrollment
  • 32. ERD for Course Registration
  • 33. Rough ERD Plus Primary Keys
  • 34. Identify Attributes • In this step we try to identify and name all the attributes essential to the system we are studying without trying to match them to particular entities. • The best way to do this is to study the forms, files and reports currently kept by the users of the system and circle each data item on the paper copy. • Cross out those which will not be transferred to the new system, extraneous items such as signatures, and constant information which is the same for all instances of the form (e.g. your company name and address). The remaining circled items should represent the attributes you need. You should always verify these with your system users. (Sometimes forms or reports are out of date.) • The only attributes indicated are the names of the departments, projects, supervisors and employees, as well as the supervisor and employee NUMBER and a unique project number.
  • 35. Map Attributes • For each attribute we need to match it with exactly one entity. Often it seems like an attribute should go with more than one entity (e.g. Name). In this case you need to add a modifier to the attribute name to make it unique (e.g. Customer Name, Employee Name, etc.) or determine which entity an attribute "best' describes. • If you have attributes left over without corresponding entities, you may have missed an entity and its corresponding relationships. Identify these missed entities and add them to the relationship matrix now.
  • 38. Check ERD Results • Look at your diagram from the point of view of a system owner or user. Is everything clear? • Check through the Cardinality pairs. • Also, look over the list of attributes associated with each entity to see if anything has been omitted.
  • 39. Questions • Feel Free to ask any Questions