SlideShare a Scribd company logo
Entity-Relationship Model in
Database
By
Dr. Kamalakanta Sethi
Entity-Relationship Model
• It is a high level data model used for developing conceptual design of
the database.
• ER model was introduced by Peter Chenn in 1976.
• It works around real world entities and relationship among them.
• ER describes the structure or blueprint of the database with the help
of a diagram called Entity-Relationship diagram.
• The main components of ER Model is
 Entity set
 Relationship set
Entity Set
 Entity is a real world object having either physical existence (e.g.,
student, house) or conceptual existence (e.g., company, job, etc).
 Entity set is a collection of similar type of entities that share same
properties (or attributes).
Ex: A student entity set consists of all students of a school
 Entity set is represented by rectangle in ER diagram.
Attributes
 Attributes are used to describe the properties of an entity.
Ex: A student entity may have different attributes such as Name,
Age, Mobile No, etc.
 For each attribute there is a set of permitted values called domain of
that attribute.
Ex: A student Name can not be numeric
 There are different types of attributes
 simple and composite attribute
 single valued and multi-valued attribute
 derived attribute
 key attribute
Relationship set
 The logical association among entities is called relationship.
Ex: Enrolled in’ is a relationship that exists between
entities Student and Course.
 A set of relationships of similar type is called relationship set.
Cardinality ratio
• Cardinality ratio defines the number of entities of an entity set A which can
be associated with number of entities of another entity set B via a
relationship.
• Based on cardinality, there are four types of relationships
 one to one relationship
 one to many relationship
 many to one relationship
 many to many relationship
Participation Constraints
 Participation constraints defines whether all entities in the entity set are
participating in the relationship set or not.
 Total Participation
Partial Participation
 Total Participation: Each entity in the entity set must have at least one
relationship in the relationship set. (here all entities)
 Partial Participation: Each entity in the entity set may or may not have
relationship in the relationship set.
ER Diagram drawing steps
Step 1 − Identifying the entity sets.
Step 2 − Identifying the attributes for the given entity sets
Step 3 − Identifying the Key attributes
Step 4 − Identifying the relationship between entity sets
Step 5 − Identify cardinality constraints
Step 6 − identify participation constraints
7/2/2024 8
ER diagram for Banking system
• Bank have Customer.
• Banks are identified by a name, code, address of main office.
• Banks have branches.
• Branches are identified by a branch_no., branch_name, address.
• Customers are identified by name, cust-id, phone number, address.
• Customer can have one or more accounts.
• Accounts are identified by account_no., acc_type, balance.
• Customer can avail loans.
• Loans are identified by loan_id, loan_type and amount.
• Account and loans are related to bank’s branch.
7/2/2024 9
ER Diagram for Banking System
Conversion of ER Model to Relational Model
Rule 1: For strong entity set with only simple attributes
A strong entity set with only simple attributes will require only one table in relational
model.
 Attributes of the table will be the attributes of the entity set.
 The primary key of the table will be the key attribute of the entity set.
7/2/2024 12
-
 Relational model does not handle composite attributes. A strong entity set with any
number of composite attributes will require only one table in relational model.
 While conversion, simple attributes of the composite attributes are taken into
account and not the composite attribute itself.
7/2/2024 13
Rule 2: For strong entity set with only composite attributes
A strong entity set with multi valued attributes will require two tables in relational model.
• One table will contain all the simple attributes (add simple attributes of the composite
attribute if it is present) along with key attribute. The key attribute become primary key of
the table.
• Other table will contain the key attribute and all the multi valued attributes. Key attribute
and multivalued attribute of entity set becomes primary key of table.
7/2/2024 14
Roll No City
1 Balasore
1 Jamshedpur
3 Bhubaneswar
Roll No Mobile No
1 9437018765
1 8249544124
2 9834587698
Rule 3: For strong Entity Set with multi-valued attributes
The following four cases are possible
Case-1: Binary relationship with cardinality ratio M:M (many to many relationship)
Case-2: Binary relationship with cardinality ratio 1:M (one to many relationship)
Case-3: Binary relationship with cardinality ratio M:1 (many to one relationship)
Case-4: Binary relationship with cardinality ratio 1:1 (one to one relationship)
7/2/2024 15
Rule 4: For binary relationships with cardinality constraints
Case-1: Binary relationship with cardinality ratio M:M (many to many relationship)
To convert this Relationship set into relational schema,
• Relationship set is mapped as separate relation
• Key attributes of participating entity sets are mapped as primary key for that
relation.
Case-2 and Case-3: one to many and many to one relationship
 Separate relation is created for all participating entity sets.
 Key attribute of one side entity set is mapped as foreign key in many
side relation.
Case-4: Binary relationship with cardinality ratio 1:1 (one to one)
Here, two tables will be required. Either combine ‘R’ with ‘A’ or ‘B’
option-01:
AR ( a1 , a2 , b1 )
B ( b1 , b2 )
option-02:
A ( a1 , a2 )
BR ( a1 , b1 , b2 )
Thank
you…
7/2/2024 19

More Related Content

PPTX
Entity Relationship Diagram – ER Diagram in DBMS.pptx
PPTX
Entity Relationship Diagram – ER Diagram in DBMS.pptx
PPTX
Unit 1 Data Modeling_Updated (2) (2).pptx
PPTX
Er diagrams presentation
PPTX
Er diagrams presentation
PPTX
entityrelationshipmodel.pptx
PDF
erdiagramspresentation-150826044953-lva1-app6891.pdf
PDF
Basic concepts of Data and Databases
Entity Relationship Diagram – ER Diagram in DBMS.pptx
Entity Relationship Diagram – ER Diagram in DBMS.pptx
Unit 1 Data Modeling_Updated (2) (2).pptx
Er diagrams presentation
Er diagrams presentation
entityrelationshipmodel.pptx
erdiagramspresentation-150826044953-lva1-app6891.pdf
Basic concepts of Data and Databases

Similar to Entity Relationship Model in Database System (20)

DOCX
ER Diagram_Kameshwari.docx
PPTX
Revision ch 3
PPTX
Entity-Relationship Diagram (ERD) Material.pptx
PDF
Unit 2 DBMS
PPTX
Chapter 2. Concepctual design -.pptx
PPTX
Entityrelationshipmodel
PPTX
Database Management System DBMS ER diagram.
PPTX
DBMS Conceptual Design using ER Model.pptx
PDF
Data & Databases
PPT
Entity Relation -model presentation ppts
PPT
Entity Relation -model presentation ppts
PPT
ER-model_for_web_development_1111111.ppt
PPT
Entity Relationship Diagram Models UML.ppt
PPTX
Entity Relationship Diagram Concept.pptx
PPT
18306_lec-2 (1).ppt
PPTX
PPT
E R Model details.ppt
PPTX
database.pptx
PPTX
Entity relationship Models from Chapter 4
PPTX
Er model
ER Diagram_Kameshwari.docx
Revision ch 3
Entity-Relationship Diagram (ERD) Material.pptx
Unit 2 DBMS
Chapter 2. Concepctual design -.pptx
Entityrelationshipmodel
Database Management System DBMS ER diagram.
DBMS Conceptual Design using ER Model.pptx
Data & Databases
Entity Relation -model presentation ppts
Entity Relation -model presentation ppts
ER-model_for_web_development_1111111.ppt
Entity Relationship Diagram Models UML.ppt
Entity Relationship Diagram Concept.pptx
18306_lec-2 (1).ppt
E R Model details.ppt
database.pptx
Entity relationship Models from Chapter 4
Er model
Ad

Recently uploaded (20)

PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PPTX
additive manufacturing of ss316l using mig welding
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
bas. eng. economics group 4 presentation 1.pptx
PPTX
Sustainable Sites - Green Building Construction
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
DOCX
573137875-Attendance-Management-System-original
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
UNIT-1 - COAL BASED THERMAL POWER PLANTS
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
Model Code of Practice - Construction Work - 21102022 .pdf
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
UNIT 4 Total Quality Management .pptx
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
additive manufacturing of ss316l using mig welding
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
Internet of Things (IOT) - A guide to understanding
bas. eng. economics group 4 presentation 1.pptx
Sustainable Sites - Green Building Construction
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
573137875-Attendance-Management-System-original
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Automation-in-Manufacturing-Chapter-Introduction.pdf
Ad

Entity Relationship Model in Database System

  • 2. Entity-Relationship Model • It is a high level data model used for developing conceptual design of the database. • ER model was introduced by Peter Chenn in 1976. • It works around real world entities and relationship among them. • ER describes the structure or blueprint of the database with the help of a diagram called Entity-Relationship diagram. • The main components of ER Model is  Entity set  Relationship set
  • 3. Entity Set  Entity is a real world object having either physical existence (e.g., student, house) or conceptual existence (e.g., company, job, etc).  Entity set is a collection of similar type of entities that share same properties (or attributes). Ex: A student entity set consists of all students of a school  Entity set is represented by rectangle in ER diagram.
  • 4. Attributes  Attributes are used to describe the properties of an entity. Ex: A student entity may have different attributes such as Name, Age, Mobile No, etc.  For each attribute there is a set of permitted values called domain of that attribute. Ex: A student Name can not be numeric  There are different types of attributes  simple and composite attribute  single valued and multi-valued attribute  derived attribute  key attribute
  • 5. Relationship set  The logical association among entities is called relationship. Ex: Enrolled in’ is a relationship that exists between entities Student and Course.  A set of relationships of similar type is called relationship set.
  • 6. Cardinality ratio • Cardinality ratio defines the number of entities of an entity set A which can be associated with number of entities of another entity set B via a relationship. • Based on cardinality, there are four types of relationships  one to one relationship  one to many relationship  many to one relationship  many to many relationship
  • 7. Participation Constraints  Participation constraints defines whether all entities in the entity set are participating in the relationship set or not.  Total Participation Partial Participation  Total Participation: Each entity in the entity set must have at least one relationship in the relationship set. (here all entities)  Partial Participation: Each entity in the entity set may or may not have relationship in the relationship set.
  • 8. ER Diagram drawing steps Step 1 − Identifying the entity sets. Step 2 − Identifying the attributes for the given entity sets Step 3 − Identifying the Key attributes Step 4 − Identifying the relationship between entity sets Step 5 − Identify cardinality constraints Step 6 − identify participation constraints 7/2/2024 8
  • 9. ER diagram for Banking system • Bank have Customer. • Banks are identified by a name, code, address of main office. • Banks have branches. • Branches are identified by a branch_no., branch_name, address. • Customers are identified by name, cust-id, phone number, address. • Customer can have one or more accounts. • Accounts are identified by account_no., acc_type, balance. • Customer can avail loans. • Loans are identified by loan_id, loan_type and amount. • Account and loans are related to bank’s branch. 7/2/2024 9
  • 10. ER Diagram for Banking System
  • 11. Conversion of ER Model to Relational Model
  • 12. Rule 1: For strong entity set with only simple attributes A strong entity set with only simple attributes will require only one table in relational model.  Attributes of the table will be the attributes of the entity set.  The primary key of the table will be the key attribute of the entity set. 7/2/2024 12
  • 13. -  Relational model does not handle composite attributes. A strong entity set with any number of composite attributes will require only one table in relational model.  While conversion, simple attributes of the composite attributes are taken into account and not the composite attribute itself. 7/2/2024 13 Rule 2: For strong entity set with only composite attributes
  • 14. A strong entity set with multi valued attributes will require two tables in relational model. • One table will contain all the simple attributes (add simple attributes of the composite attribute if it is present) along with key attribute. The key attribute become primary key of the table. • Other table will contain the key attribute and all the multi valued attributes. Key attribute and multivalued attribute of entity set becomes primary key of table. 7/2/2024 14 Roll No City 1 Balasore 1 Jamshedpur 3 Bhubaneswar Roll No Mobile No 1 9437018765 1 8249544124 2 9834587698 Rule 3: For strong Entity Set with multi-valued attributes
  • 15. The following four cases are possible Case-1: Binary relationship with cardinality ratio M:M (many to many relationship) Case-2: Binary relationship with cardinality ratio 1:M (one to many relationship) Case-3: Binary relationship with cardinality ratio M:1 (many to one relationship) Case-4: Binary relationship with cardinality ratio 1:1 (one to one relationship) 7/2/2024 15 Rule 4: For binary relationships with cardinality constraints
  • 16. Case-1: Binary relationship with cardinality ratio M:M (many to many relationship) To convert this Relationship set into relational schema, • Relationship set is mapped as separate relation • Key attributes of participating entity sets are mapped as primary key for that relation.
  • 17. Case-2 and Case-3: one to many and many to one relationship  Separate relation is created for all participating entity sets.  Key attribute of one side entity set is mapped as foreign key in many side relation.
  • 18. Case-4: Binary relationship with cardinality ratio 1:1 (one to one) Here, two tables will be required. Either combine ‘R’ with ‘A’ or ‘B’ option-01: AR ( a1 , a2 , b1 ) B ( b1 , b2 ) option-02: A ( a1 , a2 ) BR ( a1 , b1 , b2 )