7/30/25, 7:56 PM Introduction of ER Model - GeeksforGeeks
Search...
Introduction of ER Model
Last Updated : 23 Jul, 2025
The Entity-Relationship Model (ER Model) is a conceptual model for
designing a databases. This model represents the logical structure of a
database, including entities, their attributes and relationships between them.
Entity: An objects that is stored as data such as Student, Course or
Company.
Attribute: Properties that describes an entity such as StudentID,
CourseName, or EmployeeEmail.
Relationship: A connection between entities such as "a Student enrolls in
a Course".
Components of ER Diagram
The graphical representation of this model is called an Entity-Relation
Diagram (ERD).
ER Model in Database Design Process
We typically follow the below steps for designing a database for an
application.
Gather the requirements (functional and data) by asking questions to the
database users.
Create a logical or conceptual design of the database. This is where ER
model plays a role. It is the most used graphical representation of the
conceptual design of a database.
https://www.geeksforgeeks.org/dbms/introduction-of-er-model/ 1/17
7/30/25, 7:56 PM Introduction of ER Model - GeeksforGeeks
After this, focus on Physical Database Design (like indexing) and external
design (like views)
Why Use ER Diagrams In DBMS?
ER diagrams represent the E-R model in a database, making them easy to
convert into relations (tables).
These diagrams serve the purpose of real-world modeling of objects
which makes them intently useful.
Unlike technical schemas, ER diagrams require no technical knowledge of
the underlying DBMS used.
They visually model data and its relationships, making complex systems
easier to understand.
Symbols Used in ER Model
ER Model is used to model the logical view of the system from a data
perspective which consists of these symbols:
Rectangles: Rectangles represent entities in the ER Model.
Ellipses: Ellipses represent attributes in the ER Model.
Diamond: Diamonds represent relationships among Entities.
Lines: Lines represent attributes to entities and entity sets with other
relationship types.
Double Ellipse: Double ellipses represent multi-valued Attributes, such
as a student's multiple phone numbers
Double Rectangle: Represents weak entities, which depend on other
entities for identification.
https://www.geeksforgeeks.org/dbms/introduction-of-er-model/ 2/17
7/30/25, 7:56 PM Introduction of ER Model - GeeksforGeeks
Symbols used in ER Diagram
What is an Entity?
An Entity represents a real-world object, concept or thing about which data
is stored in a database. It act as a building block of a database. Tables in
relational database represent these entities.
Example of entities:
Real-World Objects: Person, Car, Employee etc.
Concepts: Course, Event, Reservation etc.
Things: Product, Document, Device etc.
The entity type defines the structure of an entity, while individual instances
of that type represent specific entities.
What is an Entity Set?
An entity refers to an individual object of an entity type, and the collection of
all entities of a particular type is called an entity set. For example, E1 is an
entity that belongs to the entity type "Student," and the group of all
students forms the entity set.
In the ER diagram below, the entity type is represented as:
https://www.geeksforgeeks.org/dbms/introduction-of-er-model/ 3/17
7/30/25, 7:56 PM Introduction of ER Model - GeeksforGeeks
Entity Set
We can represent the entity sets in an ER Diagram but we can't represent
individual entities because an entity is like a row in a table, and an ER
diagram shows the structure and relationships of data, not specific data
entries (like rows and columns). An ER diagram is a visual representation of
the data model, not the actual data itself.
Types of Entity
There are two main types of entities:
1. Strong Entity
A Strong Entity is a type of entity that has a key Attribute that can uniquely
identify each instance of the entity. A Strong Entity does not depend on any
other Entity in the Schema for its identification. It has a primary key that
ensures its uniqueness and is represented by a rectangle in an ER diagram.
2. Weak Entity
A Weak Entity cannot be uniquely identified by its own attributes alone. It
depends on a strong entity to be identified. A weak entity is associated with
an identifying entity (strong entity), which helps in its identification. A weak
entity are represented by a double rectangle. The participation of weak
entity types is always total. The relationship between the weak entity type
https://www.geeksforgeeks.org/dbms/introduction-of-er-model/ 4/17
7/30/25, 7:56 PM Introduction of ER Model - GeeksforGeeks
and its identifying strong entity type is called identifying relationship and it
is represented by a double diamond.
Example:
A company may store the information of dependents (Parents, Children,
Spouse) of an Employee. But the dependents can't exist without the
employee. So dependent will be a Weak Entity Type and Employee will be
identifying entity type for dependent, which means it is Strong Entity Type.
Strong Entity and Weak Entity
Attributes in ER Model
Attributes are the properties that define the entity type. For example, for a
Student entity Roll_No, Name, DOB, Age, Address, and Mobile_No are the
attributes that define entity type Student. In ER diagram, the attribute is
represented by an oval.
Attribute
Types of Attributes
1. Key Attribute
The attribute which uniquely identifies each entity in the entity set is called
the key attribute. For example, Roll_No will be unique for each student. In
ER diagram, the key attribute is represented by an oval with an underline.
Key Attribute
https://www.geeksforgeeks.org/dbms/introduction-of-er-model/ 5/17
7/30/25, 7:56 PM Introduction of ER Model - GeeksforGeeks
2. Composite Attribute
An attribute composed of many other attributes is called a composite
attribute. For example, the Address attribute of the student Entity type
consists of Street, City, State, and Country. In ER diagram, the composite
attribute is represented by an oval comprising of ovals.
Composite Attribute
3. Multivalued Attribute
An attribute consisting of more than one value for a given entity. For
example, Phone_No (can be more than one for a given student). In ER
diagram, a multivalued attribute is represented by a double oval.
Multivalued Attribute
4. Derived Attribute
An attribute that can be derived from other attributes of the entity type is
known as a derived attribute. e.g.; Age (can be derived from DOB). In ER
diagram, the derived attribute is represented by a dashed oval.
Derived Attribute
https://www.geeksforgeeks.org/dbms/introduction-of-er-model/ 6/17
7/30/25, 7:56 PM Introduction of ER Model - GeeksforGeeks
The Complete Entity Type Student with its Attributes can be represented as:
Entity and Attributes
Relationship Type and Relationship Set
A Relationship Type represents the association between entity types. For
example, ‘Enrolled in’ is a relationship type that exists between entity type
Student and Course. In ER diagram, the relationship type is represented by a
diamond and connecting the entities with lines.
Entity-Relationship Set
A set of relationships of the same type is known as a relationship set. The
following relationship set depicts S1 as enrolled in C2, S2 as enrolled in C1,
and S3 as registered in C3.
https://www.geeksforgeeks.org/dbms/introduction-of-er-model/ 7/17
7/30/25, 7:56 PM Introduction of ER Model - GeeksforGeeks
Relationship Set
Degree of a Relationship Set
The number of different entity sets participating in a relationship set is
called the degree of a relationship set.
1. Unary Relationship: When there is only ONE entity set participating in a
relation, the relationship is called a unary relationship. For example, one
person is married to only one person.
Unary Relationship
2. Binary Relationship: When there are TWO entities set participating in a
relationship, the relationship is called a binary relationship. For example, a
Student is enrolled in a Course.
Binary Relationship
3. Ternary Relationship: When there are three entity sets participating in a
relationship, the relationship is called a ternary relationship.
https://www.geeksforgeeks.org/dbms/introduction-of-er-model/ 8/17
7/30/25, 7:56 PM Introduction of ER Model - GeeksforGeeks
4. N-ary Relationship: When there are n entities set participating in a
relationship, the relationship is called an n-ary relationship.
Cardinality in ER Model
The maximum number of times an entity of an entity set participates in a
relationship set is known as cardinality.
Cardinality can be of different types:
1. One-to-One
When each entity in each entity set can take part only once in the
relationship, the cardinality is one-to-one. Let us assume that a male can
marry one female and a female can marry one male. So the relationship will
be one-to-one.
One to One Cardinality
Using Sets, it can be represented as:
Set Representation of One-to-One
2. One-to-Many
https://www.geeksforgeeks.org/dbms/introduction-of-er-model/ 9/17
7/30/25, 7:56 PM Introduction of ER Model - GeeksforGeeks
In one-to-many mapping as well where each entity can be related to more
than one entity. Let us assume that one surgeon department can
accommodate many doctors. So the Cardinality will be 1 to M. It means one
department has many Doctors.
one to many cardinality
Using sets, one-to-many cardinality can be represented as:
Set Representation of One-to-Many
3. Many-to-One
When entities in one entity set can take part only once in the relationship set
and entities in other entity sets can take part more than once in the
relationship set, cardinality is many to one.
Let us assume that a student can take only one course but one course can be
taken by many students. So the cardinality will be n to 1. It means that for
one course there can be n students but for one student, there will be only
one course.
https://www.geeksforgeeks.org/dbms/introduction-of-er-model/ 10/17
7/30/25, 7:56 PM Introduction of ER Model - GeeksforGeeks
many to one cardinality
Using Sets, it can be represented as:
Set Representation of Many-to-One
In this case, each student is taking only 1 course but 1 course has been taken
by many students.
4. Many-to-Many
When entities in all entity sets can take part more than once in the
relationship cardinality is many to many. Let us assume that a student can
take more than one course and one course can be taken by many students.
So the relationship will be many to many.
https://www.geeksforgeeks.org/dbms/introduction-of-er-model/ 11/17
7/30/25, 7:56 PM Introduction of ER Model - GeeksforGeeks
many to many cardinality
Using Sets, it can be represented as:
Many-to-Many Set Representation
In this example, student S1 is enrolled in C1 and C3 and Course C3 is
enrolled by S1, S3, and S4. So it is many-to-many relationships.
Participation Constraint
Participation Constraint is applied to the entity participating in the
relationship set.
1. Total Participation: Each entity in the entity set must participate in the
relationship. If each student must enroll in a course, the participation of
students will be total. Total participation is shown by a double line in the ER
diagram.
2. Partial Participation: The entity in the entity set may or may NOT
participate in the relationship. If some courses are not enrolled by any of the
students, the participation in the course will be partial.
The diagram depicts the ‘Enrolled in’ relationship set with Student Entity set
having total participation and Course Entity set having partial participation.
https://www.geeksforgeeks.org/dbms/introduction-of-er-model/ 12/17
7/30/25, 7:56 PM Introduction of ER Model - GeeksforGeeks
Total Participation and Partial Participation
Using Set, it can be represented as,
Set representation of Total Participation and Partial Participation
Every student in the Student Entity set participates in a relationship but
there exists a course C4 that is not taking part in the relationship.
How to Draw an ER Diagram
1. Identify Entities: The very first step is to identify all the Entities.
Represent these entities in a Rectangle and label them accordingly.
2. Identify Relationships: The next step is to identify the relationship
between them and represent them accordingly using the Diamond shape.
Ensure that relationships are not directly connected to each other.
3. Add Attributes: Attach attributes to the entities by using ovals. Each
entity can have multiple attributes (such as name, age, etc.), which are
connected to the respective entity.
4. Define Primary Keys: Assign primary keys to each entity. These are
unique identifiers that help distinguish each instance of the entity. Represent
them with underlined attributes.
5. Remove Redundancies: Review the diagram and eliminate unnecessary or
repetitive entities and relationships.
6. Review for Clarity: Review the diagram make sure it is clear and
effectively conveys the relationships between the entities.
https://www.geeksforgeeks.org/dbms/introduction-of-er-model/ 13/17
7/30/25, 7:56 PM Introduction of ER Model - GeeksforGeeks
Entity
Relat
Mode
DBMS
ER
Diagr
in DB
ER
Diagr
Relat
in DB
ER
Entity Relationship Model in
DBMS
Visit Course
Comment More info Advertise with us Next Article
Introduction to Database
Normalization
Similar Reads
SQL Tutorial
Structured Query Language (SQL) is the standard language used to interact with relational databases.
Whether you want to create, delete, update or read data, SQL provides the structure and commands to…
8 min read
Basics
Queries & Operations
SQL Joins & Functions
Data Constraints & Aggregate Functions
Advanced SQL Topics
https://www.geeksforgeeks.org/dbms/introduction-of-er-model/ 14/17
7/30/25, 7:56 PM Introduction of ER Model - GeeksforGeeks
Database Design & Security
Introduction of ER Model
The Entity-Relationship Model (ER Model) is a conceptual model for designing a databases. This model
represents the logical structure of a database, including entities, their attributes and relationships…
10 min read
Introduction to Database Normalization
Normalization is an important process in database design that helps improve the database's efficiency,
consistency, and accuracy. It makes it easier to manage and maintain the data and ensures that the…
6 min read
SQL Injection
SQL Injection is a security flaw in web applications where attackers insert harmful SQL code through user
inputs. This can allow them to access sensitive data, change database contents or even take control of t…
7 min read
SQL Data Encryption
In today’s digital era, data security is more critical than ever, especially for organizations storing the
personal details of their customers in their database. SQL Data Encryption aims to safeguard…
5 min read
SQL Backup
In SQL Server, a backup, or data backup is a copy of computer data that is created and stored in a
different location so that it can be used to recover the original in the event of a data loss. To create a full…
4 min read
What is Object-Relational Mapping (ORM) in DBMS?
Object-relational mapping (ORM) is a key concept in the field of Database Management Systems (DBMS),
addressing the bridge between the object-oriented programming approach and relational databases.…
7 min read
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate
Tower, Sector- 136, Noida, Uttar Pradesh
(201305)
Registered Address:
K 061, Tower K, Gulshan Vivante
Apartment, Sector 137, Noida, Gautam
Buddh Nagar, Uttar Pradesh, 201305
https://www.geeksforgeeks.org/dbms/introduction-of-er-model/ 15/17
7/30/25, 7:56 PM Introduction of ER Model - GeeksforGeeks
Advertise with us
Company Languages
About Us Python
Legal Java
Privacy Policy C++
In Media PHP
Contact Us GoLang
Advertise with us SQL
GFG Corporate Solution R Language
Placement Training Program Android Tutorial
Tutorials Archive
DSA Data Science & ML
DSA Tutorial Data Science With Python
Basic DSA Problems Data Science For Beginner
DSA Roadmap Machine Learning
Top 100 DSA Interview Problems ML Maths
DSA Roadmap by Sandeep Jain Data Visualisation
All Cheat Sheets Pandas
NumPy
NLP
Deep Learning
Web Technologies Python Tutorial
HTML Python Programming Examples
CSS Python Projects
JavaScript Python Tkinter
TypeScript Python Web Scraping
ReactJS OpenCV Tutorial
NextJS Python Interview Question
Bootstrap Django
Web Design
Computer Science DevOps
Operating Systems Git
Computer Network Linux
Database Management System AWS
Software Engineering Docker
Digital Logic Design Kubernetes
Engineering Maths Azure
Software Development GCP
Software Testing DevOps Roadmap
System Design Inteview Preparation
https://www.geeksforgeeks.org/dbms/introduction-of-er-model/ 16/17
7/30/25, 7:56 PM Introduction of ER Model - GeeksforGeeks
High Level Design Competitive Programming
Low Level Design Top DS or Algo for CP
UML Diagrams Company-Wise Recruitment Process
Interview Guide Company-Wise Preparation
Design Patterns Aptitude Preparation
OOAD Puzzles
System Design Bootcamp
Interview Questions
School Subjects GeeksforGeeks Videos
Mathematics DSA
Physics Python
Chemistry Java
Biology C++
Social Science Web Development
English Grammar Data Science
Commerce CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
https://www.geeksforgeeks.org/dbms/introduction-of-er-model/ 17/17