0% found this document useful (0 votes)
5 views39 pages

ER - Model - Part-2 of DBMS

This ppt explains The Entity relationship model In Database Management systems
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views39 pages

ER - Model - Part-2 of DBMS

This ppt explains The Entity relationship model In Database Management systems
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 39

Entity Relationship Model in

DBMS
What is an ER Model?
• ER Model stands for Entity-Relationship
Model.
• It is a high-level conceptual data model.
• Used to define data elements and relationships
for a system.
• ER model is best used for database design.
Components of ER Model
• Entities: Real-world objects (e.g., Student,
Course).
• Attributes: Properties of entities (e.g., Name,
Age).
• Relationships: Associations between entities
(e.g., Enrolled).
Components of ER Diagram

Entity-Relation
The graphical representation of this model is called an Diagram (ERD
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.
Symbols Used in ER Model
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.
• Real-World Objects: Person, Car, Employee
etc.
• Concepts: Course, Event, Reservation etc.
• Things: Product, Document, Device etc.
The entity type is represented as:
Types of Entity
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.
Types of Entity
Attributes in ER Model
Attribute: Properties that describes an entity such
as StudentID, CourseName, or EmployeeEmail.
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
• 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.
• 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.
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.
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
• 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
Degree of a 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.
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
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.
Cardinality in ER Model
The maximum number of times an entity of an
entity set participates in a relationship set is
known as cardinality.
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.
2. One-to-Many
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.
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.
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.
Types of Cardinality in ER-Model
There can be 4 types of cardinality -
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.
Constructing of ER Diagrams
Follow the Steps for constructing ER Diagrams
1. Identify the Entities
2. Identify the Attributes and primary key
3. Identify the relationship
4. Identify the Cardinality Ration
5. Identify the Participation Constraints

You might also like