Entity-Relationship (ER) diagram, which can
be mapped into a Relational Model by
converting entities, relationships, and
attributes into relational tables.
Steps for Mapping ER Model to
Relational Model:
1. Convert Entities to Relations (Tables)
Each entity in the ERdiagram is mapped
to a table with its attributes as columns.
o Employee (Employee_ID as Primary
Key)
OCopy code
Employee(ssn, F_name, M_name,
L_name, B_date, Address, Gender
Salary, Department_ID)
Department (Department_|D as
Primary Key)
OCopy code
Department (Department_ID, Name,
Location, Number_of_Employees)
Project (Project_ID as Primary Key)
O Copy code
Project (Project_ID, Name,
Location, Number)
Dependent (Dependent_ID as Primary
Key, Employee_ID as Foreign Key)
OCopy code
Dependent (Dependent_ID,
Employee_ID, Name, Gender,
Birthdate, Relationship)
2. Convert Relationships into Tables
Relationships with many-to-many
cardinality are represented as separate
tables.
o Works_On (for many-to-many
Employee-Project relationship)
O Copy code
Works_On ( Employee_ID, Project_ID,
Hours)
Manages (for one-to-one or
one-to-many Employee-Department
relationship)
OCopy code
Manages (Employee_ID,
Department_ID, Start_date)
o Supervision (for one-to-many
Employee-Employee relationship
where an Employee supervises
another Employee)
O Copy code
Supervision(Supervisor_ID,
Employee_ID)
Controls (for one-to-many
Department-Project relationship)
O Copy code
Controls (Depar tment_ID,
Project_ID)
Controls(Department_ID,
Project_ID)
Dependence_0f (for one-to-many
Employee-Dependent relationship)
O Copy code
Dependence_0f(Employee_ID,
Dependent_ID)
Key Points:
Primary keys are used to uniquely identify
records in each table.
" Foreign keys establish relationships
between tables.
" Many-to-many relationships require
separate tables.
One-to-many relationships use foreign
keys in the child table.
This approach ensures data is
well-structured and normalized, reducing
redundancy while maintaining referential
integrity.