SlideShare une entreprise Scribd logo
1  sur  30
Entity Relationship Diagram (ERD)
Presented by,
RAKHI MUKHERJI
BSc. Part-3 (Computer Hons.)
12181SC102
OBJECTIVES
 To understand What is an ERD & why it is used?
 Define terms related to entity relationship modeling,
including entity, relationship ,cardinality, attributes
,primary key.
 Describe the steps involved in entity relationship
diagram.
 Describe how to recognize entities, attributes,
relationships, and cardinalities.
 Discuss how to draw an entity relationship diagram with
the help of an example.
*
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.
The ERD is used to communicate the logical
structure of the database to users
ERD is a model that identifies the
entities that exist in a system and the
relationships between those entities
ERD is a graphical tool for modeling
data.
ER model allows us to sketch
database designs
Components of an ERD
An ERD
consists of
four
components
Entity
Relationship
Cardinality
Attributes
BASIC CONCEPTS
WHAT IS ENTITY?
• Person, place, object, event or concept about
which data is to be maintained
• Examples of entities:
– Person: EMPLOYEE, STUDENT, PATIENT
– Place: STORE, WAREHOUSE
– Object: MACHINE, PRODUCT, CAR
– Event: SALE,REGISTRATION, RENEWAL
– Concept: ACCOUNT, COURSE
WHAT IS ENTITY?
• Person
WHAT IS ENTITY?
• Place
WHAT IS ENTITY?
• Object
WHAT IS ENTITY?
• Event
 Associations between instances of one or more entity types that is of
interest
Meaningful association among several entities.
 Given a name that describes its function.
Author Book
Writes
 Unary Relationship: between two instances of
one entity type.
Student
Cheats
from
Binary Relationship : between the instances of
two entity types.
Teacher Teaches Subject
 Ternary Relationship : among the instances of
three entity types
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
• Cardinality : minimum and maximum number of
instances of Entity B that can (or must be)
associated with each instance of entity A.
CARDINALITY EXAMPLE
SCHOOL
STUDENT
Each school enrolls
at least zero
and at most many
students
Each student attends
at least one
and at most one
school
ATTRIBUTES
Descriptive properties possessed by
each member of an entity set.
Example of entity types and
associated attributes:
Student: Student_name
Employee: Employee_age
Event: Event_location
Student
Name Gender Class
Roll
number
Age
Primary Key: An attribute that has
been selected as the unique identifying
characteristic for an entity type.
Example:
Student: Student_rollnumber
Staff: Staff_Id
General Steps to create an ERD
Identify
the
entity
Identify
the
relation
between
entities
Identify
the
Cardinality
constraint
Identify
the
entity's
attributes
Draw the
ERD
A Simple Example
A company has several departments. Each
department has a supervisor and at least one
employee. Every supervisor has only one
department under him. 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 company has several departments. Each department has
a supervisor and at least one employee. Every supervisor
has only one department under him 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
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
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.
ERD with Cardinality
Employee
Supervisor
Project
• Employee Name
• Employee No.
• Supervisor Name
• Supervisor No.
• Project Name
• Project No.
Department Department
Name
ATTRIBUTES
Rough ERD Plus Primary Keys
Fully Attributed ERD
Department
Is Assign
Supervisor
Employee ProjectWorks
On
Runs
By
Department
Name
Project
Name
Project
Number
Employee
Number
Supervisor
Number
Supervisor
Name
Employee
Name
Entity Relationship Diagram

Contenu connexe

Tendances

Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship ModelSlideshare
 
ER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMSER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMSRubal Sagwal
 
2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMSkoolkampus
 
2 database system concepts and architecture
2 database system concepts and architecture2 database system concepts and architecture
2 database system concepts and architectureKumar
 
Entity Relationship Modelling
Entity Relationship ModellingEntity Relationship Modelling
Entity Relationship ModellingBhandari Nawaraj
 
Relationship Types of degree higher than 2
Relationship Types of degree higher than 2Relationship Types of degree higher than 2
Relationship Types of degree higher than 2Aadesh Shrestha
 
ER DIAGRAM & ER MODELING IN DBMS
ER DIAGRAM & ER MODELING IN DBMSER DIAGRAM & ER MODELING IN DBMS
ER DIAGRAM & ER MODELING IN DBMSssuser20b618
 
Data modeling using the entity relationship model
Data modeling using the entity relationship modelData modeling using the entity relationship model
Data modeling using the entity relationship modelJafar Nesargi
 
Relational database
Relational database Relational database
Relational database Megha Sharma
 
Data Redundancy & Update Anomalies
Data Redundancy & Update AnomaliesData Redundancy & Update Anomalies
Data Redundancy & Update AnomaliesJens Patel
 
Degree of relationship set
Degree of relationship setDegree of relationship set
Degree of relationship setMegha Sharma
 
Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]
Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]
Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]Usman Tariq
 
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
FUNCTION DEPENDENCY  AND TYPES & EXAMPLEFUNCTION DEPENDENCY  AND TYPES & EXAMPLE
FUNCTION DEPENDENCY AND TYPES & EXAMPLEVraj Patel
 

Tendances (20)

Entity relationship modelling
Entity relationship modellingEntity relationship modelling
Entity relationship modelling
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship Model
 
Databases: Normalisation
Databases: NormalisationDatabases: Normalisation
Databases: Normalisation
 
ER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMSER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMS
 
2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS
 
2 database system concepts and architecture
2 database system concepts and architecture2 database system concepts and architecture
2 database system concepts and architecture
 
Entity Relationship Modelling
Entity Relationship ModellingEntity Relationship Modelling
Entity Relationship Modelling
 
DBMS PPT
DBMS PPTDBMS PPT
DBMS PPT
 
Relationship Types of degree higher than 2
Relationship Types of degree higher than 2Relationship Types of degree higher than 2
Relationship Types of degree higher than 2
 
ER DIAGRAM & ER MODELING IN DBMS
ER DIAGRAM & ER MODELING IN DBMSER DIAGRAM & ER MODELING IN DBMS
ER DIAGRAM & ER MODELING IN DBMS
 
Data modeling using the entity relationship model
Data modeling using the entity relationship modelData modeling using the entity relationship model
Data modeling using the entity relationship model
 
Different data models
Different data modelsDifferent data models
Different data models
 
EER modeling
EER modelingEER modeling
EER modeling
 
Relational database
Relational database Relational database
Relational database
 
Conceptual Data Modeling
Conceptual Data ModelingConceptual Data Modeling
Conceptual Data Modeling
 
Data Redundancy & Update Anomalies
Data Redundancy & Update AnomaliesData Redundancy & Update Anomalies
Data Redundancy & Update Anomalies
 
Degree of relationship set
Degree of relationship setDegree of relationship set
Degree of relationship set
 
Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]
Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]
Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]
 
Data modeling
Data modelingData modeling
Data modeling
 
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
FUNCTION DEPENDENCY  AND TYPES & EXAMPLEFUNCTION DEPENDENCY  AND TYPES & EXAMPLE
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
 

En vedette

Entity relationship diagram (erd)
Entity relationship diagram (erd)Entity relationship diagram (erd)
Entity relationship diagram (erd)tameemyousaf
 
Entity Relationship Diagram presentation
Entity Relationship Diagram presentationEntity Relationship Diagram presentation
Entity Relationship Diagram presentationSopov Chan
 
Major project report format Saloon Application
Major project report format Saloon ApplicationMajor project report format Saloon Application
Major project report format Saloon ApplicationAnuj Burnwal
 
Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)Mudasir Qazi
 

En vedette (6)

Entity relationship diagram (erd)
Entity relationship diagram (erd)Entity relationship diagram (erd)
Entity relationship diagram (erd)
 
Entity Relationship Diagram presentation
Entity Relationship Diagram presentationEntity Relationship Diagram presentation
Entity Relationship Diagram presentation
 
Erd practice exercises
Erd practice exercisesErd practice exercises
Erd practice exercises
 
Er diagram
Er diagramEr diagram
Er diagram
 
Major project report format Saloon Application
Major project report format Saloon ApplicationMajor project report format Saloon Application
Major project report format Saloon Application
 
Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)
 

Similaire à Entity Relationship Diagram (20)

Entity relationship diagram (erd)
Entity relationship diagram (erd)Entity relationship diagram (erd)
Entity relationship diagram (erd)
 
Entity relationship diagram (erd)
Entity relationship diagram (erd)Entity relationship diagram (erd)
Entity relationship diagram (erd)
 
Erd
ErdErd
Erd
 
Entity relationship diagram (erd)
Entity relationship diagram (erd)Entity relationship diagram (erd)
Entity relationship diagram (erd)
 
Jobs manager vs supervisor.pptx
Jobs manager vs supervisor.pptxJobs manager vs supervisor.pptx
Jobs manager vs supervisor.pptx
 
E_R-Diagram (2).pptx
E_R-Diagram (2).pptxE_R-Diagram (2).pptx
E_R-Diagram (2).pptx
 
Revision ch 3
Revision ch 3Revision ch 3
Revision ch 3
 
Entityrelationshipmodel
EntityrelationshipmodelEntityrelationshipmodel
Entityrelationshipmodel
 
Database design
Database designDatabase design
Database design
 
Cn presentation on the topic called as re modelling
Cn presentation on the topic called as re modellingCn presentation on the topic called as re modelling
Cn presentation on the topic called as re modelling
 
er-models.pptx
er-models.pptxer-models.pptx
er-models.pptx
 
Database part3-
Database part3-Database part3-
Database part3-
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship Model
 
Entity-Relationship Data Model
Entity-Relationship Data ModelEntity-Relationship Data Model
Entity-Relationship Data Model
 
Data Models
Data ModelsData Models
Data Models
 
Day 1 SQL.pptx
Day 1 SQL.pptxDay 1 SQL.pptx
Day 1 SQL.pptx
 
SQL.pptx
SQL.pptxSQL.pptx
SQL.pptx
 
entityrelationshipmodel.pptx
entityrelationshipmodel.pptxentityrelationshipmodel.pptx
entityrelationshipmodel.pptx
 
3-db-er_3-db-er_3-db-er_3-db-er_3-db-er.pptx
3-db-er_3-db-er_3-db-er_3-db-er_3-db-er.pptx3-db-er_3-db-er_3-db-er_3-db-er_3-db-er.pptx
3-db-er_3-db-er_3-db-er_3-db-er_3-db-er.pptx
 
Entity Relationship Diagram2
Entity Relationship Diagram2Entity Relationship Diagram2
Entity Relationship Diagram2
 

Dernier

Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
Presentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxPresentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxRosabel UA
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptshraddhaparab530
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...JojoEDelaCruz
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
Millenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptxMillenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptxJanEmmanBrigoli
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationRosabel UA
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmStan Meyer
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 

Dernier (20)

Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
Presentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxPresentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptx
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.ppt
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
Millenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptxMillenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptx
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translation
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and Film
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 

Entity Relationship Diagram

  • 1. Entity Relationship Diagram (ERD) Presented by, RAKHI MUKHERJI BSc. Part-3 (Computer Hons.) 12181SC102
  • 2. OBJECTIVES  To understand What is an ERD & why it is used?  Define terms related to entity relationship modeling, including entity, relationship ,cardinality, attributes ,primary key.  Describe the steps involved in entity relationship diagram.  Describe how to recognize entities, attributes, relationships, and cardinalities.  Discuss how to draw an entity relationship diagram with the help of an example.
  • 3. * 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. The ERD is used to communicate the logical structure of the database to users
  • 4. ERD is a model that identifies the entities that exist in a system and the relationships between those entities ERD is a graphical tool for modeling data. ER model allows us to sketch database designs
  • 5. Components of an ERD An ERD consists of four components Entity Relationship Cardinality Attributes
  • 7. WHAT IS ENTITY? • Person, place, object, event or concept about which data is to be maintained • Examples of entities: – Person: EMPLOYEE, STUDENT, PATIENT – Place: STORE, WAREHOUSE – Object: MACHINE, PRODUCT, CAR – Event: SALE,REGISTRATION, RENEWAL – Concept: ACCOUNT, COURSE
  • 12.  Associations between instances of one or more entity types that is of interest Meaningful association among several entities.  Given a name that describes its function. Author Book Writes
  • 13.  Unary Relationship: between two instances of one entity type. Student Cheats from
  • 14. Binary Relationship : between the instances of two entity types. Teacher Teaches Subject
  • 15.  Ternary Relationship : among the instances of three entity types
  • 16. 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 • Cardinality : minimum and maximum number of instances of Entity B that can (or must be) associated with each instance of entity A.
  • 17. CARDINALITY EXAMPLE SCHOOL STUDENT Each school enrolls at least zero and at most many students Each student attends at least one and at most one school
  • 18. ATTRIBUTES Descriptive properties possessed by each member of an entity set. Example of entity types and associated attributes: Student: Student_name Employee: Employee_age Event: Event_location
  • 19. Student Name Gender Class Roll number Age Primary Key: An attribute that has been selected as the unique identifying characteristic for an entity type. Example: Student: Student_rollnumber Staff: Staff_Id
  • 20. General Steps to create an ERD Identify the entity Identify the relation between entities Identify the Cardinality constraint Identify the entity's attributes Draw the ERD
  • 21. A Simple Example A company has several departments. Each department has a supervisor and at least one employee. Every supervisor has only one department under him. 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.
  • 22. • A company has several departments. Each department has a supervisor and at least one employee. Every supervisor has only one department under him 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
  • 23. 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
  • 24.
  • 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.
  • 27. Employee Supervisor Project • Employee Name • Employee No. • Supervisor Name • Supervisor No. • Project Name • Project No. Department Department Name ATTRIBUTES
  • 28. Rough ERD Plus Primary Keys
  • 29. Fully Attributed ERD Department Is Assign Supervisor Employee ProjectWorks On Runs By Department Name Project Name Project Number Employee Number Supervisor Number Supervisor Name Employee Name