Dbms Data Model
Dbms Data Model
PENKI RAMU
ASST. PROF.
Entity Relationship Diagram –
ER Diagram in DBMS
• ER model describes the structure of a database with the help of a
diagram, which is known as Entity Relationship Diagram (ER
Diagram).
• An ER model is a design or blueprint of a database that can later be
implemented as a database.
• The main components of E-R model are: entity set and relationship
set.
What is an Entity Relationship
Diagram (ER Diagram)?
• Geometric shapes and their meaning in an E-R Diagram
Rectangle: Represents Entity sets.
Ellipses: Attributes
Diamonds: Relationship Set
Lines: They link attributes to Entity Sets and Entity sets to
Relationship Set
Double Ellipses: Multivalued Attributes
Dashed Ellipses: Derived Attributes
Double Rectangles: Weak Entity Sets
Double Lines: Total participation of an entity in a relationship
set
• Two entities Student and College and their relationship
• Student entity has attributes such as Stu_Id, Stu_Name &
Stu_Addr and College entity has attributes such as Col_ID &
Col_Name.
• The relationship between Student and College is many to
one as a college can have many students however a student
cannot study in multiple colleges at the same time.
Components of a ER Diagram
ER diagram has three main components:
1. Entity
2. Attribute
3. Relationship
Weak Entity:
An entity that cannot be uniquely identified by its own attributes and
relies on the relationship with other entity is called weak entity. The
weak entity is represented by a double rectangle. For example – a
bank account cannot be uniquely identified without knowing the
bank to which the account belongs, so bank account is a weak entity.
Components of a ER Diagram
• 2. Attribute
• An attribute describes the property of an entity. An attribute is
represented as Oval in an ER diagram. There are four types of
attributes:
• 1. Key attribute
2. Composite attribute
3. Multivalued attribute
4. Derived attribute
Components of a ER Diagram
2.2. Composite attribute: 3. Multivalued attribute:
2.1. Key attribute:
An attribute that can hold multiple
values is known as multivalued
attribute. It is represented with
double ovals in an ER Diagram. For
example – A person can have more
than one phone numbers so the
phone number attribute is
multivalued.
4. Derived attribute:
A derived attribute is one whose
value is dynamic and derived from
An attribute that is a combination of
another attribute. It is represented
A key attribute can uniquely identify an entity other attributes is known as composite
by dashed oval in an ER Diagram.
from an entity set. For example, student roll attribute. For example, In student entity,
For example – Person age is a
number can uniquely identify a student from a the student address is a composite
derived attribute as it changes
set of students. Key attribute is represented by attribute as an address is composed of
over time and can be derived from
oval same as other attributes however the text other attributes such as pin code, state,
another attribute (Date of birth).
of key attribute is underlined. country.
Components of a ER Diagram
• 3. Relationship
• A relationship is represented by diamond shape in ER diagram ,It
shows the relationship among entities.
• There are four types of relationships:
• 1. One to One, 1. One to One Relationship
• 2. One to Many,
• 3. Many to One
When a single instance of an entity is associated with a single
• 4. Many to Many instance of another entity then it is called one to one
relationship.
For example, a person has only one passport and a passport is
given to one person.
Components of a ER Diagram
• 3. Relationship 3.4. Many to Many Relationship