Introduction of ER Model - GeeksforGeeks
Introduction of ER Model - GeeksforGeeks
Introduction of ER Model
Last Updated : 16 Jan, 2025
We typically follow the below steps for designing a database for an application.
The Entity Relationship Model is a model for identifying entities (like student, car
or company) to be represented in the database and representation of how those
entities are related. The ER data model specifies enterprise schema that
represents the overall logical structure of a database graphically.
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.
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 .
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
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-Relationship Set
Relationship Set
Unary Relationship
Binary 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.
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.
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.
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.
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.
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 .
They simplify the process of mapping out the database structure, making it
easier to organize data and understand how different entities interact.
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.
Relationships in ER Model
Similar Reads
7 min read
Basic of DBMS
Introduction of ER Model
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.Do a logical or conceptual design of the…
10 min read
Structural constraints, within the context of Entity-Relationship (ER) modeling, specify and determine how the
entities take part in the relationships and this gives an outline of how the interactions between the entities ca…
6 min read
The Entity-Relationship (ER) Model is one of the primary components of Database Management Systems and
is very important for designing the logical structure of databases. It helps define data, and the relationship…
7 min read
An entity is a “thing†or “object†in the real world. An entity contains attributes, which describe that
entity. So anything about which we store information is called an entity. Entities are recorded in the database…
3 min read
Using the ER model for bigger data creates a lot of complexity while designing a database model, So in order to
minimize the complexity Generalization, Specialization, and Aggregation were introduced in the ER model.…
4 min read
A relationship between two entities of the same entity set is called a recursive relationship or repeated
relationship. Here the same entity set participates more than once in a relationship type with a different role f…
3 min read
Relational Model
Relational Algebra
Functional Dependencies
Normalisation
File organization
Registered Address:
K 061, Tower K, Gulshan Vivante
Apartment, Sector 137, Noida,
Gautam Buddh Nagar, Uttar Pradesh,
201305
Advertise with us