0% found this document useful (0 votes)
319 views

WWW Geeksforgeeks Org Introduction of Er Model

Uploaded by

Harsh Jalaf
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
319 views

WWW Geeksforgeeks Org Introduction of Er Model

Uploaded by

Harsh Jalaf
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Aptitude Engineering Mathematics Discrete Mathematics Operating System DBMS Computer Networks Digital Logic and Design C Programming

esign C Programming Data Structures Algorithms Theory of Compu

Introduction of ER Model
Last Updated : 30 Aug, 2024
Peter Chen developed the ER diagram in 1976. The ER model was created to provide a simple and understandable model for representing the
structure and logic of databases. It has since evolved into variations such as the Enhanced ER Model and the Object Relationship Model
Generative Summary
The Entity Relational Model is a model for identifying entities to be represented in the database and representation
Now you can generateof how those entities are
the summary
of any article of your choice. Got it
related. The ER data model specifies enterprise schema that represents the overall logical structure of a database graphically.

The Entity Relationship Diagram explains the relationship among the entities present in the database. ER models are used to model real-world
objects like a person, a car, or a company and the relation between these real-world objects. In short, the ER Diagram is the structural format of the
database.

Why Use ER Diagrams In DBMS?


ER diagrams represent the E-R model in a database, making them easy to convert into relations (tables).
ER diagrams provide the purpose of real-world modeling of objects which makes them intently useful.
ER diagrams require no technical knowledge and no hardware support.
These diagrams are very easy to understand and easy to create even for a naive user.
It gives a standard solution for visualizing the data logically.

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.
Double Rectangle: Double Rectangle represents a Weak Entity.

Symbols used in ER Diagram

Components of ER Diagram
ER Model consists of Entities, Attributes, and Relationships among Entities in a Database System.

Components of ER Diagram

What is Entity?
An Entity may be an object with a physical existence – a particular person, car, house, or employee – or it may be an object with a conceptual
existence – a company, a job, or a university course.

What is Entity Set?


An Entity is an object of Entity Type and a set of all entities is called an entity set. For Example, E1 is an entity having Entity Type Student and the
set of all students is called Entity Set. In ER diagram, Entity Type is represented as:

Entity Set

We can represent the entity set in ER Diagram but can’t represent entity in ER Diagram because entity is row and column in the relation and ER
Diagram is graphical representation of data.

Types of Entity
There are two types of entity:

1. Strong Entity

A Strong Entity is a type of entity that has a key Attribute. Strong Entity does not depend on other Entity in the Schema. It has a primary key, that
helps in identifying it uniquely, and it is represented by a rectangle. These are called Strong Entity Types.

2. Weak Entity

An Entity type has a key attribute that uniquely identifies each entity in the entity set. But some entity type exists for which key attributes can’t be
defined. These are called Weak Entity types .

For 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 .

A weak entity type is represented by a Double Rectangle. The participation of weak entity types is always total. The relationship between the weak
entity type and its identifying strong entity type is called identifying relationship and it is represented by a double diamond.

Strong Entity and Weak Entity

What is Attributes?
Attributes are the properties that define the entity type. For example, 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 underlying lines.
Key Attribute

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

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.

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.

4. N-ary Relationship: When there are n entities set participating in a relationship, the relationship is called an n-ary relationship.

What is Cardinality?
The 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.

the total number of tables that can be used in this is 2.


one to one cardinality

Using Sets, it can be represented as:

Set Representation of One-to-One

2. One-to-Many: In one-to-many mapping as well where each entity can be related to more than one entity and the total number of tables that can
be used in this is 2. 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.

total number of tables that can used is 3.

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.

The total number of tables that can be used in this is 3.


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.

the total number of tables that can be used in this is 3.

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.

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 ER Diagram?


The very first step is Identifying all the Entities, and place them in a Rectangle, and labeling them accordingly.
The next step is to identify the relationship between them and place them accordingly using the Diamond, and make sure that, Relationships are
not connected to each other.
Attach attributes to the entities properly.
Remove redundant entities and relationships.
Add proper colors to highlight the data present in the database.

Conclusion
An Entity-Relationship (ER) model is a way to visually represent the structure of a database. It shows how different entities (like objects or
concepts) are connected and interact with each other through relationships. The model uses diagrams to represent entities as rectangles and
relationships as diamonds, making it easier to design and understand databases .

Frequently Asked Questions on ER Model – FAQs

What is the main purpose of an ER Diagram?

ER Diagrams are used to visually represent the structure of a database, showing entities, their attributes, and relationships between them.

How do ER Diagrams help in database design?

They simplify the process of mapping out the database structure, making it easier to organize data and understand how different entities
interact.

What is the difference between a Weak Entity and a Strong Entity?

A Strong Entity has a unique identifier or primary key, while a Weak Entity lacks a primary key and relies on a Strong Entity for identification.

Can ER Diagrams represent complex data relationships?

Yes, ER Diagrams can model complex relationships, including one-to-one, one-to-many, and many-to-many relationships.
Why are Participation Constraints used in ER Diagrams?

Participation Constraints indicate whether all entities must participate in a relationship or if only some may do so, helping to accurately
represent real-world scenarios.

Reference
What is Normalization in DBMS?
SQL Concepts and Queries
Data Modeling: A Comprehensive Guide for Analysts
Best Practices For Documenting Database Design

"GeeksforGeeks helped me ace the GATE exam! Whenever I had any doubt regarding any topic, GFG always helped me and made my concepts
quiet clear." - Anshika Modi | AIR 21

Choose GeeksforGeeks as your perfect GATE 2025 Preparation partner with these newly launched programs
GATE CS & IT- Online
GATE DS & AI- Online

Over 150,000+ students already trust us to be their GATE Exam guide. Join them & let us help you in opening the GATE to top-tech IITs & NITs!

Advertisement

Video | 18. Intro to ER Model in DBMS Visit Course

GeeksforGeeks 644

Previous Article Next Article


Difference between File System and DBMS Structural Constraints of Relationships in ER Model

Similar Reads
Difference between Bottom-Up Model and Top-Down Model
Top-Down Design Model: In the top-down model, an overview of the system is formulated without going into detail for any part of it. Each part of it then
refined into more details, defining it in yet more details until the entire specification is detailed enough to validate the model. if we glance at a haul as a…
3 min read

Similarities between TCP/IP model and OSI model


Pre-Requisite: Layers of OSI Model, TCP/IP Model OSI Model or Open Systems Interconnection is an architecture of 7 layers in which each layer has its
work to perform whereas TCP/IP is a concise version of the OSI Model. TCP/IP Model consists of 4 layers rather than the 7 layers of the OSI Model. Ther…
5 min read

ACID Model vs BASE Model For Database


The difference between ACID and BASE database models is the way they deal with this limitation. The ACID model provides a consistent system.The
BASE model provides high availability.To provide further insight, we will discuss each of the models separately in detail. ACID Model:Collections of…
5 min read

Difference between E-R Model and Relational Model in DBMS


In database management systems (DBMS), two key methods are the Relational model and the Entity-Relationship (E-R) model. Each has a specific
function in the development and operation of databases. While the Relational model provides the practical structure for organizing and managing data i…
3 min read

Mapping from ER Model to Relational Model


To understand this, you should have an idea about: ER model Relation model After designing the ER diagram of system, we need to convert it to
Relational models which can directly be implemented by any RDBMS like Oracle, MySQL etc. In this article we will discuss how to convert ER diagram t…
5 min read

This is exactly why we still use the OSI model when we have TCP/IP Model
What is the OSI Model?OSI is an acronym for Open Systems Interconnection. The International Organization for Standardization (ISO) created the OSI
model (ISO). It's a model for how applications communicate over the internet. In order to facilitate interoperability between diverse devices and…
10 min read

What is OSI Model? - Layers of OSI Model


OSI stands for Open Systems Interconnection , where open stands to say non-proprietary. It is a 7-layer architecture with each layer having specific
functionality to perform. All these 7 layers work collaboratively to transmit the data from one person to another across the globe. The OSI reference…
15+ min read

Difference between Relational model and Document Model


The relational model organizes data into tables with rows and columns, ideal for structured data. On the other hand, the document model stores data in
hierarchical documents, which offers more flexibility for managing unstructured or semi-structured data. Both models serve different purposes in…
3 min read

Introduction of Relational Model and Codd Rules in DBMS


Pre-Requisite: Relational Model in DBMS It was proposed by Dr. E.F. Codd. It uses the concept of relations to represent each and every file. Relations are
Two-Dimensional Tables. It is easy to implement and easy to simplification in the operations to manipulate the data. This is the most popular data mode…
12 min read

Attributes to Relationships in ER Model


In ER model, entities have attributes which can be of various types like single-valued, multi-valued, composite, simple, stored, derived and complex. But
relationships can also have attributes associated to them. Generally it is not recommended to give attributes to the relationships if not required because…
2 min read

Two State Process Model in Operating System


Pre-requisite: States of a Process in Operating Systems The process in an operating system passes from different states starting from its formation to its
completion. A process consists of program data and its associated data and a process control block (PCB). A process may change its state because of th…
3 min read

Building blocks of a Data Model


A data model is a structure of the data that contains all the required details of the data like the name of the data, size of the data, relationship with other
data and constraints that are applied on the data. It is a communication tool. A data model is essential in order to store the database in a sorted manner.…
2 min read

Difference between ER Model and RDBMS


1. ER (Entity- Relationship) Model : ER model stands for entity relationship model. It specifies the structure of a database by giving the relationship
between the entities of the system. An entity set is a group of entities that are similar to each other. It is considered as a conceptual design which can…
2 min read

Structural Constraints of Relationships in ER Model


Prerequisite - ER Model To understand Structural Constraints, we must take a look at Cardinality Ratios and Participation Constraints. Cardinality Ratios
of relationships : The entities are denoted by rectangle and relationships by diamond. There are numbers (represented by M and N) written above the…
3 min read

Relationships in ER model
Entity Relationship model (ER model) contains entities and relationships. ER model enables us to know how these entities are associated with each
other. Entities interact with other entities through associations or relationships. Let us assume that Geeks is the name of a student, Placement 100 is th…
2 min read

Difference between Hierarchical and Relational data model


1. Hierarchical Data Model : Hierarchical data model is the oldest type of data model. It was developed by IBM in 1968. It organizes data in a tree-like
structure. Hierarchical model consists of the following : It contains nodes that are connected by branches. Topmost node is called the root node. If there…
3 min read

Data Model In Neo4j


The data model in Neo4j organizes data using the concepts of nodes and relationships. Both nodes and relationships can have properties, which store the
data items associated with nodes and relationships. Nodes can have labels: A node can have zero, one, or several labels.The nodes that have the same…
3 min read

Record-Based Data Model


Data Model is the model that organizes elements of the data and tell how they relate to one-another and with the properties of real-world entities. The
basic purpose of the data model is to make sure that the data stored in the data model is understood fully. Further, it has three types- 1. Physical Data…
2 min read

Model Planning for Data Analytics


In this article, we are going to discuss model planning for data analytics in which we will cover all procedural steps one by one. Model planning is phase
3 of lifecycle phases of data analytics, where team determines methods, techniques, and workflow it intends to follow for subsequent model building…
3 min read

Key-Value Data Model in NoSQL


A key-value data model or database is also referred to as a key-value store. It is a non-relational type of database. In this, an associative array is used as a
basic database in which an individual key is linked with just one value in a collection. For the values, keys are special identifiers. Any kind of entity can b…
3 min read

Basic Object Oriented Data Model


Need of Object Oriented Data Model : To represent the complex real world problems there was a need for a data model that is closely related to real
world. Object Oriented Data Model represents the real world problems easily. Object Oriented Data Model : In Object Oriented Data Model, data and…
2 min read

How Communication happens using OSI model


The Open System Interconnection (OSI) model is a standard “reference model” created by an International Organization for Standardization (ISO) to
describe how software and hardware components involved in network communication divide efforts and interact with each other. The OSI model define…
4 min read

Physical Layer in OSI Model


The physical Layer is the bottom-most layer in the Open System Interconnection (OSI) Model which is a physical and electrical representation of the
system. It consists of various network components such as power plugs, connectors, receivers, cable types, etc. The physical layer sends data bits from…
5 min read

Deadlock System model


Overview :A deadlock occurs when a set of processes is stalled because each process is holding a resource and waiting for another process to acquire
another resource. In the diagram below, for example, Process 1 is holding Resource 1 while Process 2 acquires Resource 2, and Process 2 is waiting for…
8 min read

Regular grammar (Model regular grammars )


Prerequisites: Chomsky hierarchy Type-3 grammar/regular grammar: Regular grammar generates regular language. They have a single non-terminal on
the left-hand side and a right-hand side consisting of a single terminal or single terminal followed by a non-terminal. The productions must be in the…
5 min read

Hierarchical Model in DBMS


Hierarchical Model :This is one of the oldest models in a data model which was developed by IBM, in the 1950s. In a hierarchical model, data are viewed
as a collection of tables, or we can say segments that form a hierarchical relation. In this, the data is organized into a tree-like structure where each reco…
4 min read

Three State Process Model in Operating System


Pre-requisites: States of a Process in Operating Systems, Two-State Process Model in Operating SystemIn this article, we'll be discussing a three-state
process model in an operating system and also discussing the need for this process model, how the process executes, what will be the possible transiti…
4 min read

Columnar Data Model of NoSQL


The Columnar Data Model of NoSQL is important. NoSQL databases are different from SQL databases. This is because it uses a data model that has a
different structure than the previously followed row-and-column table model used with relational database management systems (RDBMS). NoSQL…
3 min read

Aggregate Data Model in NoSQL


We know, NoSQL are databases that store data in another format other than relational databases. NoSQL deals in nearly every industry nowadays. For
the people who interact with data in databases, the Aggregate Data model will help in that interaction. Features of NoSQL Databases: Schema Agnosti…
2 min read

Graph Based Data Model in NoSQL


Graph Based Data Model in NoSQL is a type of Data Model which tries to focus on building the relationship between data elements. As the name
suggests Graph-Based Data Model, each element here is stored as a node, and the association between these elements is often known as Links.…
3 min read

Article Tags : DBMS GATE CS DBMS-ER model

Trending in News View More

PS5 Pro Launched: Controller, Price,


Specs & Features, How to Pre-Order, and
More
How to Make Money on Twitch
How to activate Twitch on smart TV
105 Funny Things to Do to Make
Someone Laugh
#geekstreak2024 – 21 Days POTD
Challenge Powered By Deutsche Bank
Corporate & Communications Address:- A-
143, 9th 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

Company Languages
About Us Python
Legal Java
In Media C++
Contact Us PHP
Advertise with us GoLang
GFG Corporate Solution SQL
Placement Training Program R Language
GeeksforGeeks Community Android Tutorial
Tutorials Archive

DSA Data Science & ML


Data Structures Data Science With Python
Algorithms Data Science For Beginner
DSA for Beginners Machine Learning
Basic DSA Problems ML Maths
DSA Roadmap Data Visualisation
Top 100 DSA Interview Problems Pandas
DSA Roadmap by Sandeep Jain NumPy
All Cheat Sheets NLP
Deep Learning

Web Technologies Python Tutorial


HTML Python Programming Examples
CSS Python Projects
JavaScript Python Tkinter
TypeScript 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


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
World GK

@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved

You might also like