Javatpoint Logo
Javatpoint Logo

Difference between ER Model and Relational Model

The E-R Model and Relational Model are two aspects of the Data Model in DBMS that are used to construct databases at the physical, logical, and view levels. This article explains the complete overview of the E-R Model and Relational Model. The difference between these models is the most common part of an interview question. The key distinction is that the E-R Model is entity-specific, while the Relational Model is table-specific. Before making the comparison, we will first know these Data Models.

ER Model vs Relational Model

What is ER Model?

An ER model stands for the Entity-Relationship model that Peter Chen developed in 1976. This model consists of a collection of entities (Real word objects) and their relationships. It describes the database's conceptual view. We must ensure that no two entities are identical in this context.

ER Model describes the system's logical view from a data perspective formed by the entity set, relationship set, and attributes. In this model, all entities come under the entity set, all relations between the entities come under the relationship set, and attributes describe the properties of entities.

Let us understand ER model with an example. Suppose we have two real-world entities named Student and Branch that will further form an Entity set. Now we can easily form a relation between them as the Student belongs to a Branch. It shows how we can get a relationship set from ER Model. Noted that the ER Model content must conform to constraints like mapping cardinality. Finally, the attributes of these entities would be:

For Student: stud_id, stud_name, address, mobile, mail-id.

For Branch: branch_id, branch_name, num_of_stud.

What is the Relational Model?

In 1970, E.F. Codd developed the relational model. He proposed this model as well as a non-procedural approach for modeling data in the form of relations or tables. In the Relational Model, tables are usually interpreted as relations. If we model the database using ER diagrams, we must convert them into the relational model, which can be implemented by one of the RDBMS languages such as SQL and MySQL.

In the relational model, each table contains rows and columns where we can have any number of rows, but the number of columns must be definite. The table rows are called tuples that include the complete information about specific entities. Records are a set of tuples, so the Relational model is also known as the Record-based Model. Table columns are called attributes because they characterize a table's properties. To store values, each attribute must have a type.

Key Differences between ER Model and Relational Model

The following points explain the main differences between ER Model and Relational Model:

  • The main distinction between the ER model and the Relational Model is that the ER model describes the relationship between entities and their attributes. On the other hand, the Relational Model referred to the implementation of our model.
  • The Relational Model is the implementation or representational model, while the ER Model is the high-level or conceptual model.
  • The data in components such as entity sets, relationship sets, and attributes are represented by an ER model. The Relational model, on the other hand, defines data in components such as tuples, attributes, and attribute domains.
  • As compared to a Relational Model, an ER model makes it easier to understand the relationships between entities.
  • Mapping Cardinality is always a constraint in the ER model, while the cardinality constraint cannot be defined in the Relational Model.

ER Model vs. Relational Model Comparison Chart

The following comparison chart explains their main differences in a quick manner:

Comparison Basis ER Model Relational Model
Basic It's used to describe a set of objects known as entities, as well as the relationships between them. It's used to represent a collection of tables as well as the relationships between them.
Type It is a high-level or conceptual model. It is the implementation or representational model.
Components It represents components as Entity, Entity Type, and Entity Set. It represents components as domain, attributes, and tuples.
Used By This model is helpful for those people who don't have any knowledge about how data is implemented. This model is mostly famous among programmers.
Relationship It is easy to understand the relationship between entities. Compared to ER model, it is easier to derive the relation between tables in the Relational model.
Mapping This model explains how to map Cardinalities. The uniqueness of data values in a row is referred to as cardinality. This model does not describe mapping cardinalities.

Conclusion

In this article, we have made a comparison between ER Model and Relational Model. We may conclude that if we convert an E-R model to a Relational model, we must ensure that each strong entity has its own table.







Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA