Mapping from ER Model to Relational Model (original) (raw)

Last Updated : 24 Apr, 2026

Converting an Entity-Relationship (ER) diagram to a Relational Model is an important step in database design. The ER model represents the conceptual structure of a database, and the Relational Model is a physical representation that can be directly implemented using a Relational Database Management System (RDBMS) like Oracle or MySQL.

Different Cases

Case 1: Binary Relationship with 1:1 cardinality with total participation of an entity

has

Binary Relationship with 1:1 cardinality with total participation of an entity

**Note: A person has 0 or 1 passport number and Passport is always owned by 1 person. So it is 1:1 cardinality with full participation constraint from Passport.

Table 1

| **Person | | **Has | | **Passport | | | | | ------------ | ---------------------------- | ------------ | ------------- | -------------- | ----------------------------- | | | | **Per-Id | **Other Person Attribute | **Per-Id | **Pass-No | **Pass-No | **Other PassportAttribute | | | | PR1 | - | PR1 | PS1 | PS1 | - | | | | PR2 | - | PR2 | PS2 | PS2 | - | | | | PR3 | - | | | | | | |

**Table 2

Per-Id Other Person Attribute Pass-No Other PassportAttribute

**Note: So it will be the key. Pass-No can’t be key because for some person, it can be NULL.

Case 2: Binary Relationship with 1:1 cardinality and partial participation of both entities

file

Binary Relationship with 1:1 cardinality and partial participation of both entities

**Table 3

**Male **Marry **Female
M-Id Other Male Attribute M-Id F-Id F-Id Other FemaleAttribute
M1 - M1 F2 F1 -
M2 - M2 F1 F2 -
M3 - F3 -

**Table 4

M-Id Other Male Attribute F-Id

**Table 5

F-Id Other FemaleAttribute

**Note: Binary relationship with 1:1 cardinality will have 2 table if partial participation of both entities in the relationship. If atleast 1 entity has total participation, number of tables required will be 1.

Case 3: Binary Relationship with n: 1 cardinality

e_id

Binary Relationship with n: 1 cardinality

**Table 6

**Student **Enrolls **Elective_Course
S-Id Other Student Attribute S-Id E-Id E-Id Other Elective CourseAttribute
S1 - S1 E1 E1 -
S2 - S2 E2 E2 -
S3 - S3 E1 E3 -
S4 - S4 E1

**Table 7

S-Id Other Student Attribute E-Id

**Table 8

E-Id Other Elective CourseAttribute

**Note: The resultant tables are shown in Table 7 and Table 8. Primary Keys have been underlined.

Case 4: Binary Relationship with m: n cardinality

enrolls

Binary Relationship with m: n cardinality

**Table 9

**Student **Enrolls **Compulsory_Courses
S-Id Other Student Attribute S-Id C-Id C-Id Other Compulsory CourseAttribute
S1 - S1 C1 C1 -
S2 - S1 C2 C2 -
S3 - S3 C1 C3 -
S4 - S4 C3 C4 -
S4 C2
S3 C3

**Note: All tables’ keys are different, these can’t be merged. Primary Keys of all tables have been underlined.

Case 5: Binary Relationship with weak entity

dependants

Binary Relationship with weak entity

Table 10

**Employee **Has **Dependents
E-Id Other Employee Attribute E-Id D-Name D-Name E-Id Other DependentsAttribute
E1 - E1 RAM RAM E1 -
E2 - E1 SRINI SRINI E1 -
E3 - E2 RAM RAM E2 -
E3 ASHISH ASHISH E3 -

**Table 11

E-Id Other Employee Attribute

**Table 12

D-Name E-Id Other DependentsAttribute

**Note: So the resultant tables are shown in Tables 11 and 12. Primary Keys of all tables have been underlined.