What is the ER Model in DBMS?

In Database Management System, a Data Model is a set of tools that is used to logically define the database design at each level of abstraction. In other words, it is a collection of tools to describe the data, data relationships, data semantics, and Consistency Constraints. The Data Models are of many types like Relational Model, ER Model, Object Oriented Model, etc. In this article, we will discuss the ER Model in DBMS.

The ER Model is an abbreviation for Entity Relationship Model. This data model deals with two things- the Entities and the Relationship among the various Entities in the Database. Before discussing Entity Relationship Model in DBMS, let’s first discuss some basic terminologies.

  • Entity:  An Entity in a Database is a real-world object which can be described in terms of some features. For example, a box is a real-world object which can be described in terms of shape, size, and color. Here, shape, size, and color are features of the box, the Entity.
  • Attributes: The attributes are the characteristics that describe the entity of the database. For example, shape, size, and color in the above case.
  • Relationship: Relationship is the logical binding between the different entities which exist in the Database. Suppose, two entities are Parent and Child. Then, the relationship would be ‘gave birth to.’ It means the parent ‘gave birth to the child, so the parent and child are related in this way.

Therefore, the above terminologies form the foundation for ER Model in DBMS.

ER Model Definition and Example

An ER Model is the Data Model which is described as the logical representation of data in the form of objects and the relationship among them. The objects are called entities and the set of features that describe the entity is called an ‘attribute set.’

For example, in the database of a school, the students are interpreted as entities that have attributes such as Name, Roll Number, Section, Course Enrolled, etc. In this way, entities in ER Model can be represented and the diagram which shows the Entities and Relationships among them is called ER Diagram.

Now, let’s see if the ER Model in DBMS can be represented using the ER Diagram.

Components of ER Diagram

Since, ER Model in DBMS includes the Entities, Relations, and Attributes, these are called the components of ER Diagram. The following Diagram shows the Components of ER Diagram which are discussed here in detail.

Entity

As discussed earlier, an Entity is an object defined in terms of some features. An Entity can be of the following types:

  1. Weak Entity: It depends on some other entity. It has no meaning in the diagram without its parent entity. For example, a Son cannot exist without Father. So, Son is a Weak Entity.
  2. Strong Entity: It exists as an independent Entity in the Diagram. For example, the principal of a college does not depend on any entity so it’s a strong entity.

These are represented in ER Model in DBMS as below:

Attributes

These describe the entity in the ER Diagram. They are of the following types:

  1. Key Attribute: It represents a primary key to uniquely identify an object. It defines the main feature of an entity. An example of a Key Attribute is Employee ID which is unique for each employee.
  2. Composite Attribute: When an Attribute has its sub-attributes, it is called a composite attribute. An example of a composite attribute is Address, which has street no., colony name, city name, and pin code as its attributes
  3. Multivalued Attribute: When there are multiple values possible for an attribute, it is called a multivalued attribute. For example, there can be more than one phone number for a customer. Thus, a phone number is a multivalued attribute.
  4. Derived Attribute: When the attribute has been derived from some other attribute, it is called the derived attribute. An example of a derived attribute is the work experience of an employee in a company, which can be derived from the date of his joining the company

In ER Diagram in DBMS, attributes are represented using ellipse in the following way:

Relationship

A Relationship is the association among the entities. It is represented using Rhombus. For example, Employee and company are two entities then relationship between these two can be given as follows:

  1. Unary Relationship: When only one entity participates in a relationship, it is called Unary Relationship.
  2. Binary Relationship: When two entities participate in a relationship, it is called Binary Relationship.
  3. N-ary Relationship: When n number of entities participate in the relationship, it is termed an n-ary relationship.

Relationships are also defined in terms of cardinality in DBMS which will be discussed later. Therefore, ER Model finds its importance in representing the objects or entities in terms of specific features and establishing a proper relationship among them.