Importance of Entity-Relationship diagram in database
design
Assist the Database Developer
The ER Diagram assists the design even before the construction of tables
begins.
Requirements Gathering
This helps the users to plan how to organize data.
Documentation Tool
ER Diagrams can work as a documentation to make others understand the core
of the database.
Logic of the database
It communicates the logical structure of the database to the users.
Blueprint
An ER Diagram is considered as the blueprint of the database.
How to Draw ER Diagrams
Preparing to Draw an ER Diagram
Diagram
Before we start drawing the ER diagram, it is essential to gather requirements and
identify the entities involved. This preparation phase sets the groundwork for creating a
comprehensive and effective ER diagram.
Consider the following steps:
1) Start by understanding the goals and objectives of your project. Gather all necessary
information about the system or database you are working with.
2) Identify the main entities involved in the system. These entities can represent real-
world objects, concepts, or people.
3) Consider the relationships between the identified entities. Determine how they
interact and depend on each other.
Step 1: Defining Entities
In this step, we define the entities and their attributes. Start by identifying the main
entities involved in the system. Consider the following tips:
• Identify the entities that are most relevant to your project. These can be tangible
objects, concepts, or individuals.
• Define the attributes for each entity. Attributes are the properties or characteristics that
describe the entity. For example, if you are working on a student database, attributes for
the "Student" entity could include student ID, name, address, and date of birth.
Step 2: Establishing Relationships
Establishing relationships between entities is a crucial aspect of an ER diagram.
Relationships define how entities are connected or associated with each other.
Consider the following:
• Determine the relationships between the identified entities. Common relationship types
include one-to-one, one-to-many, and many-to-many.
• Define the cardinality and participation constraints of each relationship. Cardinality
refers to the number of instances that can be associated with another entity, while
participation constraints determine whether a relationship is mandatory or optional for
an entity.
Step 3: Adding Attributes
Attributes provide additional information about entities. In this step, we focus on
specifying attributes for each entity:
• Add relevant attributes to the entities identified in the previous steps. Attributes help
provide a more detailed understanding of the entities and their relationships.
• Specify the properties and characteristics of each attribute. For example, if you have
an attribute called "Age" for the "Student" entity, define its data type (integer, string, etc.)
and any constraints associated with it.
Step 4: Refining the Diagram
In this final step, we focus on refining the ER diagram to enhance clarity and readability:
• Organize the entities and relationships in a logical and intuitive manner. Group related
entities together and arrange them in a way that reflects their connections.
• Review the diagram for clarity, ensuring that it effectively communicates the
relationships between entities. Eliminate any ambiguity or confusion.
PreviousNext
      Tutorial Playlist
Table of Contents
What is an ER Diagram?
What is an ER Model?
History of ER models
Why Use ER Diagrams in DBMS?
Symbols Used in ER Diagrams
View More
An Entity Relationship Diagram is a diagram that represents relationships
among entities in a database. It is commonly known as an ER Diagram. An
ER Diagram in DBMS plays a crucial role in designing the database. Today’s
business world previews all the requirements demanded by the users in the
form of an ER Diagram. Later, it's forwarded to the database administrators
to design the database.
What is an ER Diagram?
An Entity Relationship Diagram (ER Diagram) pictorially explains the
relationship between entities to be stored in a database. Fundamentally, the
ER Diagram is a structural design of the database. It acts as a framework
created with specialized symbols for the purpose of defining the relationship
between the database entities. ER diagram is created based on three
principal components: entities, attributes, and relationships.
The following diagram showcases two entities - Student and Course, and
their relationship. The relationship described between student and course is
many-to-many, as a course can be opted by several students, and a student
can opt for more than one course. Student entity possesses attributes -
Stu_Id, Stu_Name & Stu_Age. The course entity has attributes such as Cou_ID
& Cou_Name.
 Want a Top Software Development Job? Start Here!
Full Stack Development-MEANEXPLORE PROGRAM
What is an ER Model?
An Entity-Relationship Model represents the structure of the database with
the help of a diagram. ER Modelling is a systematic process to design a
database as it would require you to analyze all data requirements before
implementing your database.
History of ER models
Peter Chen proposed ER Diagrams in 1971 to create a uniform convention
that can be used as a conceptual modeling tool. Many models were
presented and discussed, but none were suitable. The data structure
diagrams offered by Charles Bachman also inspired his model.
Why Use ER Diagrams in DBMS?
        ER Diagram helps you conceptualize the database and lets you know
         which fields need to be embedded for a particular entity
        ER Diagram gives a better understanding of the information to be stored in
         a database
      It reduces complexity and allows database designers to build databases
       quickly
      It helps to describe elements using Entity-Relationship models
      It allows users to get a preview of the logical structure of the database
Symbols Used in ER Diagrams
      Rectangles: This Entity Relationship Diagram symbol represents entity
       types
      Ellipses: This symbol represents attributes
      Diamonds: This symbol represents relationship types
      Lines: It links attributes to entity types and entity types with other
       relationship types
      Primary key: Here, it underlines the attributes
      Double Ellipses: Represents multi-valued attributes
 Want a Top Software Development Job? Start Here!
Full Stack Development-MEANEXPLORE PROGRAM
Components of ER Diagram
You base an ER Diagram on three basic concepts:
        Entities
                   Weak Entity
        Attributes
                   Key Attribute
                   Composite Attribute
                    Multivalued Attribute
                    Derived Attribute
           Relationships
                    One-to-One Relationships
                    One-to-Many Relationships
                    Many-to-One Relationships
                    Many-to-Many Relationships
Entities
An entity can be either a living or non-living component.
It showcases an entity as a rectangle in an ER diagram.
For example, in a student study course, both the student and the course are
entities.
Weak Entity
An entity that makes reliance over another entity is called a weak entity
You showcase the weak entity as a double rectangle in ER Diagram.
In the example below, school is a strong entity because it has a primary key
attribute - school number. Unlike school, the classroom is a weak entity
because it does not have any primary key and the room number here acts
only as a discriminator.
Attribute
An attribute exhibits the properties of an entity.
You can illustrate an attribute with an oval shape in an ER diagram.
Key Attribute
Key attribute uniquely identifies an entity from an entity set.
It underlines the text of a key attribute.
For example: For a student entity, the roll number can uniquely identify a
student from a set of students.
 Want a Top Software Development Job? Start Here!
Full Stack Development-MEANEXPLORE PROGRAM
Composite Attribute
An attribute that is composed of several other attributes is known as a
composite attribute.
An oval showcases the composite attribute, and the composite attribute oval
is further connected with other ovals.
Multivalued Attribute
Some attributes can possess over one value, those attributes are called
multivalued attributes.
The double oval shape is used to represent a multivalued attribute.
Derived Attribute
An attribute that can be derived from other attributes of the entity is known
as a derived attribute.
In the ER diagram, the dashed oval represents the derived attribute.
Relationship
The diamond shape showcases a relationship in the ER diagram.
It depicts the relationship between two entities.
In the example below, both the student and the course are entities, and
study is the relationship between them.
One-to-One Relationship
When a single element of an entity is associated with a single element of
another entity, it is called a one-to-one relationship.
For example, a student has only one identification card and an identification
card is given to one person.
One-to-Many Relationship
When a single element of an entity is associated with more than one element
of another entity, it is called a one-to-many relationship
For example, a customer can place many orders, but an order cannot be
placed by many customers.
Many-to-One Relationship
When more than one element of an entity is related to a single element of
another entity, then it is called a many-to-one relationship.
For example, students have to opt for a single course, but a course can have
many students.
Many-to-Many Relationship
When more than one element of an entity is associated with more than one
element of another entity, this is called a many-to-many relationship.
For example, you can assign an employee to many projects and a project
can have many employees.