What is ER Model in DBMS, Entity and Attributes in DBMS?

Data is the backbone of any application, and it is important to manage data efficiently for better decision-making. Entity-relationship (ER) modeling is a popular approach used to design databases. ER modeling is based on the concept of entities, attributes, and relationships.

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 in DBMS

The ER model is based on the idea of representing the real-world entities and their relationships in a database.

  • ER model stands for Entity-Relationship model.
  • It is a graphical representation that shows how data are related to each other within a system.
  • It was introduced by Peter Chen in 1976 and is widely used in database design.
  • The ER model is based on the idea of representing real-world entities and their relationships in a database.
  • The ER model consists of entities, attributes, and relationships.
  • This modeling technique is used to define the relationships and constraints between entities in a database.
  • It provides a clear and concise view of data requirements and relationships, and it helps in designing an efficient database.
  • It is a conceptual data model, it is based on concepts means it’s only a model which helps to understand the database.
  • It is based on the perception of the real world that consists of a collection of objects (called entities) and the relationship among those objects.

 

Why use ER Diagrams?

  • ER diagrams provide a visual representation of data relationships, making it easier to understand and communicate the structure of a database.
  • ER diagrams can be used to design and plan a database system and help to ensure that all data requirements are captured and properly represented.
  • Helps to understand the relationship between entities, So we can easily understand the database.
  • They serve as a documentation tool that can be used to explain the data model to stakeholders.
  • ER diagrams can be used to create a blueprint for system or application development.
  • It can be used to communicate with technical and non-technical users alike.
  • It helps to identify and resolve potential issues in the database design, such as data duplication or missing relationships.
  • It helps to identify entities and their relationships, and are used to understand complex business processes and workflows.

 

Components of ER Diagram

Now let’s discuss what are the basic components of ER Diagram.

Entity

  • An entity is a real-world object, concept, or event that has its own unique identity.
  • An entity could be anything like a person, place, object, event, or concept, which we can store like data in the database.
  • So an entity may be an object with a physical existence (like a person, a vehicle, a house, a 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 a rectangle.

 

Entity Set

  • 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 Set image 2

 

Entity or Entity Set both are represented by rectangle symbol

entity set image 3

 

Types of Entity

  • Strong Entity
  • Weak Entity

1. Strong Entity

  • A strong entity is an entity that has a unique identity of its own and does not depend on any other entity for its existence.
  • 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.

 

Strong Entity

 

2. 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.

Weak Entity

 

 

Attributes

  • Every entity has some kind of information, which is called attributes of that entity. So Attributes are the properties of an Entity.
  • For Example: 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. Or
  • Employees have Emp_ID, Name, Ph_no, DOB, Salary, etc.

Types of Attributes

  1. Key Attribute
  2. Simple and Composite Attribute
  3. Single Value and Multivalued Attributes
  4. 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 as a key attribute, which helps to identify the student entity from the Students entity set.

 

Key Attribute

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.

 

Composite Attribute

 

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.

 

Multivalued Attributes

 

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.

 

Derived Attributes

 

 

 

Also Read:

error: Content is protected !!