×

Conversion of ER Diagram into Relational Model

After designing the Entity-Relationship diagram, you need to convert it into tables in the relational model. Because the relational model can be easily implemented by the Relational DBMS like Oracle, MySQL, etc.

There are some rules for converting the ER diagram into tables which are as follows:

Rule1: Conversion of an entity set into a table

a) Representation of Strong entity set with simple attributes

Create a relation R for each strong entity set. Simple attributes of an entity set in the ER diagram and relation will be the same. And the key of an ER diagram will become a primary key of the relation.

For example:

Table Employee

Table: Employee

employee_id name Age city mobile no

b) Representation of Strong entity set with composite attributes

While converting the ER diagram into the Relational model, the composite attributes can be merged as individual columns.

For example:

Table Student

Table: Student

Roll no First Name Middle name Last name Course

c) Representation of Strong entity set with a multivalued attribute

The multivalued attribute is represented by double line ellipse in the ER diagram. While converting the ER diagram into the Relational model, strong entity with multivalued attribute requires two tables in the relational model. One table represents the simple attributes with the primary key, and the other represents all multivalued attributes with the primary key.

For example:

Table Employee1

Table: Employee

Employee_id Name Age

Table: Employee_e-mail

Employee_id e-mail Phone

d) Representation of Weak entity set

Create a relation R for each weak entity set. All the attributes of the weak entity set in the ER diagram will become the columns of the relation R. But the key attribute in the ER diagram cannot form the primary key of the relation. You have to add a foreign key, which would be the primary key column of its strong entity.

For example:
In below ER diagram, the Subjects is the weak entity set. Hence, create a relation for it. The field Subjects_id and Subjects_name form the column of this relation. Although Subjects_id is represented as a key attribute in the ER diagram, it cannot be considered as a primary key in the relation model. To add the primary key to the field in the relation, find the foreign key first. The Course is the strong entity related to Subjects. Hence, the Course_id, which is a primary key of Course, is added to Subjects relation as a foreign key. Now, create a composite key by using Course_id and Subjects_id.

Table Course
Table course 2

Rule 2: Conversion of Relationship into relation

Create a relation for each relationship and add the primary keys of all participating entities as an attribute of relation with their respective data types. If a relationship in an ER diagram has any attribute, add each attribute as a column of relation. Declare all foreign key constraints and a primary key composing all the primary keys of participating entities.

For example:

Table Works_in

Table: Works_in

Joining_Date employee_id Department_id

Related Topics

Advantages and Disadvantages of DBMS

We need to understand what is Database Management System before discussing the advantages and disadvantages of the database management system, and also, need to understand what were the technologies and...

5 minutes read.

Query processing in DBMS

Operations on DBMSs are made much simpler, more organized, and methodical with SQL. These are not only simpler for people to comprehend, but after gaining a basic comprehension of them, they...

4 minutes read.

Red-Black Tree Visualization in DBMS

Introduction to Red Black Tree A red-black tree is a self-balanced binary search tree with an extra bit per node, usually read as a color (red or black). The tree is...

4 minutes read.

Applications of DBMS

There are various fields where a database management system is used. Following are some applications which make use of the database management system: 1. Railway Reservation System: In the railway reservation...

7 minutes read.

How to draw ER-Diagram in DBMS?

Entity Relationship Diagrams, or ERDs, are diagrams that assist you in visualizing your database design. An ERD, also called anER diagram or ER model,describes data and how parts of the data interact. ERDs are crucial in database architecture and projects that call for...

9 minutes read.

Structure of DBMS

DBMS means Database Management System, which is a tool or software used to create the database or delete, or manipulate the database. Query Processor, Storage Manager, and Disk Storage are the...

3 minutes read.

Redundancy in Database Management System

Redundancy in a database management system (DBMS) refers to the duplication of data within the database. This duplication can occur in multiple ways, such as having multiple copies of the...

13 minutes read.

File Organization in DBMS

File Organization in DBMS: A database contains a huge amount of data, which is stored is in the physical memory in the form of files. A file is a set...

9 minutes read.

Domain in DBMS

Constraints: Constraints in DBMS are a set of guidelines that guarantee that authorized users who modify the database do not alter the consistency of the data. Constraints are expressed in DDL...

3 minutes read.

3- Tier Architecture in DBMS

Three-tier architecture is an application software architecture that arranges the output into three parts or tiers that are:  the presentation tier, where the user interacts with the application; the application...

4 minutes read.

What is Transaction in DBMS

A transaction is a collection of logically related operations which reads and possibly updates the various data items in the database. Usually, a transaction is initiated by a user program written in high-level...

3 minutes read.

Domain Constraints in DBMS

Introduction about DBMS:- DBMS stands for DataBase Management System. DBMS(DataBase Management System) is a type of software by which we can save and retrieve the user's data with the security process....

3 minutes read.

States of Transaction in DBMS

Transaction States A transaction passes through many different states in its life cycle. These states are known as transaction states. A transaction can be in one of the following states in the database: Active statePartially...

3 minutes read.

Aggregate Functions in DBMS

Aggregate Functions in DBMS: Aggregate functions are those functions in the DBMS which takes the values of multiple rows of a single column and then form a single value by...

2 minutes read.

Fragmentation in Distributed DBMS

Fragmentation is a course of isolating the entire or full information base into different sub tables or sub relations with the goal that information can be put away in various...

4 minutes read.

Disadvantages of DBMS

Disadvantages of DBMS With the vast list of advantages, there are some following disadvantages or limitations of the database management system. 1. High Cost The high cost of software and hardware is the...

2 minutes read.

Concurrent Execution of Transaction

In the transaction process, a system usually allows executing more than one transaction simultaneously. This process is called a concurrent execution. Advantages of concurrent execution of a transaction Decrease waiting time or...

4 minutes read.

Serializability in DBMS

Serializability in DBMS Serializability is the concept in a transaction that helps to identify which non-serial schedule is correct and will maintain the database consistency. It relates to the isolation property of transaction in...

3 minutes read.

Defference between Database and Data Warehouse

Database A database is a collection of related information is called a database. It has some elements that can be mapped to real-world objects. It is designed in such a manner...

4 minutes read.

Red-Black Tree Deletion in DBMS

Introduction To Red Black Tree Each node's extra bit in a red-black tree, a type of self-balancing binary search tree, is frequently understood as the color (red or black). The balance...

3 minutes read.