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

intro to er model

The ER model, or Entity-Relationship model, is a high-level data model used in database management systems to represent the logical view of a system from a data perspective. An ER diagram visually depicts entities, attributes, and relationships, with entities classified as strong or weak, and attributes categorized into simple, composite, single-valued, multi-valued, and derived. Relationships can be unary, binary, or ternary, and participation constraints indicate whether participation is total or partial.

Uploaded by

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

intro to er model

The ER model, or Entity-Relationship model, is a high-level data model used in database management systems to represent the logical view of a system from a data perspective. An ER diagram visually depicts entities, attributes, and relationships, with entities classified as strong or weak, and attributes categorized into simple, composite, single-valued, multi-valued, and derived. Relationships can be unary, binary, or ternary, and participation constraints indicate whether participation is total or partial.

Uploaded by

tharungoudthanda
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

WHAT IS ER MODEL?

ER model in DBMS is the high-level data model. It stands for the Entity-relationship model and is
used to represent a logical view of the system from a data perspective. In simple words, the entity
relationship diagram is a blueprint that can used to create a database. E-R diagrams are used to model
real-world objects like a person, a car, a company and the relation between these real-world objects.

WHAT IS ER-DIAGRAM?
ER-Diagram is a pictorial representation of data that describes how data is communicated and related
to each other.
Components of ER Diagram:

ER diagram basically having three components:

1. ENTITIES
It is a real-world thing which can be a person, place, or even a concept. For Example: Department,
Admin, Courses, Teachers, Students, Building, etc are some of the entities of a School Management
System.
Entities are of two types:
Strong Entity – A strong entity is an entity type that has a key attribute. It doesn't depend on other
entities in the schema. A strong entity always has a primary key, and it is represented by a single
rectangle in the ER diagram.

Weak Entity-An entity that depends on another entity called a weak entity. The weak entity doesn't
contain any key attribute of its own. The weak entity is represented by a double rectangle.
2. ATTRIBUTES
An entity which contains a real-world property called an attribute. For Example: The entity employee
has the property like employee id, salary, age, etc.
Following is the Attributes of an Entity
o Simple Attribute:
It is also known as atomic attributes. When an attribute cannot be divided further, then it is called a
simple attribute.

For example, in a student table, the age attribute cannot be further divided. It is called a simple or
atomic attribute because it contains only a single value that cannot be broken further.
o Composite Attribute:
Composite attributes are those that are made up of the composition of more than one attribute. When
any attribute can be divided further into more sub-attributes, then that attribute is called a composite
attribute.
For example, in a student table, we have attributes of student names that can be further broken down
into first name, middle name, and last name. So the student name will be a composite attribute.
Another example from a personal detail table would be the attribute of address. The address can be
divided into a street, area, district, and state.
o Single-valued Attribute:
Those attributes which can have exactly one value are known as single valued attributes. They
contain singular values, so more than one value is not allowed.

For example, the Age of a student can be a single valued attribute. Another example is gender
because one person can have only one gender.
o Multi-valued Attribute:
Those attributes which can have more than one entry or which contain more than one value are called
multi valued attributes.
In the Entity Relationship (ER) diagram, we represent the multi valued attribute by double oval
representation.

For example, the hobbies of a person because one can have more than one hobby, so that it would be
a multi valued attribute. Another example is one person can have more than one phone number.
Derived Attribute:
When one attribute can be derived from the other attribute, then it is called a derived attribute. We
can do some calculations on normal attributes and create derived attributes.
For example, the age of a student can be a derived attribute because we can get it by the DOB of the
student.
Another example can be of working experience, which can be obtained by the date of joining of an
employee.
In the ER diagram, we represent the derived attributes by a dotted oval shape.
o Key Attribute:
Those attributes which can be identified uniquely in the relational table are called key attributes.

For example, a student roll-no is a unique attribute.

Student Entity with all types of Attributes


We can understand the attributes by the following example:
In the above example, we have an ER diagram of a table named Student. We have a lot of attributes
from the above table.
o DOB is a single valued attribute that can have only one value.
o Name is a composite attribute because it is made up of a first name and the last name as the
middle name attribute.
o Age attribute is a derived attribute, and it is represented by a dotted oval. We can get the age
by the other attribute DOB.
o Hobbies is a multi-valued attribute because one student can have more than one hobby, which
is represented by a double oval representation.
o Roll no is a key attribute that can have a unique value (roll no) for each student.

3. RELATIONSHIP
Relationship tells how two attributes are related. For Example: Employee works for a department.
Degree of a Relationship Set
The number of entity sets that participate in a relationship set is termed as the degree of that
relationship set. Thus,
Degree of a relationship set = Number of entity sets participating in a relationship set
Types of Relationship Sets
On the basis of degree of a relationship set, a relationship set can be classified into the following
types-
 Unary relationship set
 Binary relationship set
 Ternary relationship set
Unary Relationship Set
Unary relationship set is a relationship set where only one entity set participates in a relationship set.

Binary Relationship Set


Binary relationship set is a relationship set where two entity sets participate in a relationship set.

Ternary Relationship Set


Ternary relationship set is a relationship set where three entity sets participate in a relationship set.
Participation Constraints
Total Participation of an Entity set
Total participation of an entity set represents that each entity in entity set must have at least one
relationship in a relationship set. It is also called mandatory participation. Total participation is
represented using a double line between the entity set and relationship set.
Partial participation of an Entity Set
Partial participation of an entity set represents that each entity in the entity set may or may not
participate in the relationship instance in that relationship set. It is also called as optional
participation. Partial participation is represented using a single line between the entity set and
relationship set.

Component Symbol

Entity

Weak Entity

Attribute
Component Symbol

Key Attribute

Composite Attribute

Multivalued Attribute

Derived Attribute

Relationship

Weak Relationship
Component Symbol

Participation Constraints

You might also like