In this tutorial, we will discuss What is ER Model in DBMS? and also discuss components of the ER model which include- entity, types of entity, attributes, and types of attributes. So let’s begin
ER model is a model or is a graphical representation of entities or you can say ER model gives you a visual representation of data.
ER model describes how data is related to each other. It helps to describe the structure of a database.
ER model helps to understand what the relationship between entities are, So we can easily understand the database.
ER model is a conceptual data model, it is based on concepts means it’s only a model which helps to understand the database means how we work on the database
It is based on the perception of the real world that consists of a collection of objects (called entities) and of the relationship among those objects.
Components of ER Diagram
In the real-world, an entity can be an object, which either living or non-living, which can be easily identifiable.
An entity could be anything like a person, place, object, event or a concept, which we can store like a data in the database.
So an entity may be an object with a physical existence (like a person, a vehicle, a house, pen, pencil anything) or it may be an object with a conceptual existence (like a school, a course, a company, a job, anything)
Every entity contains some attributes, which describe to that entity. means every entity has some information called attributes, so anything about which we can store information we can say an entity.
In ER model, an entity is represented by the rectangle.
An entity set is a collection of similar types of entities that share the same attributes. So it’s a set of all the same type of entities
for example: All the students of a school are an entity set of “STUDENTS” entity
Entity or Entity Set both are represented by rectangle symbol
Types of Entity
i. Strong Entity
Strong entity should have a key attribute, means an entity set having an attribute, which can be used as a candidate key or primary key is called a strong entity set.
For example, Employees or Students have Employee_ID or Student_ID, so they are strong entities.
ii. Weak Entity
A weak entity set does not contain any key attributes means the entity set which does not any sufficient attributes to form a primary key is called a weak entity set.
A weak entity always depends on another entity.
Every entity has some kind of information, which is called attributes of that entity. So Attributes are the properties of an Entity.
Students have some information, which describes that student identity like stu_name, stu_class, stu_age, stu_phone_no, etc. So these are the attributes of Students.
Employees have Emp_ID, Name, Ph_no, DOB, Salary, etc.
Types of Attributes
- Key Attribute
- Simple and Composite Attribute
- Single Value and Multivalued Attributes
- Stored and Derived Attributes
1. Key Attribute
A key attribute is used to uniquely identify an entity from an entity set.
For example, A school has so many Students so to find a particular student we need student roll no, so that roll no is used a key attribute, which helps to identify the student entity from Students entity set.
Also Read: Database Keys in DBMS
2. Simple and Composite Attribute
Simple attributes are those attributes that cannot be divided into parts. It is also called an atomic value.
For example: Roll no, class, DOB, etc.
Composite Attributes are those attributes that can be subdivided into other attributes.
For example, the Address can be subdivided into state, city, street no, zip code, etc.
3. Single Value and Multivalued Attributes
Single value attributes are those attributes, which can take only one value, which means a single value attribute can have only a single value.
For example, a person can have only one DOB or Age. Or
A student can have only one Roll_no.
Multivalued Attributes are those attributes, which can take more than one value, which means multivalued attributes can have multiple values.
A person can have multiple Phone_no or Email_id.
4. Stored and Derived Attributes
Stored Attributes are those attributes, which are physically stored in the database.
Derived attributes are those attributes, which are not physically stored in the database. These attributes value are derived from other attributes.
For example, Age is a derived attribute because it is not physically stored in the database. It is calculated with the help of DOB.