Normalization-examples
Normalization-examples
This question is smilar to the one of pre board. Try it yourself first. Then only see the solution
Orde Customer Customer Produ Product Quan Suppli Supplier Supplier Order
rID Name Phone ctID Name tity erID Name Phone Date
987654321 ABC 12345678 2023-
101 Dipson 201 Laptop 1 S1
0 Corp 90 08-01
912345678 Smartpho 09876543 2023-
102 Pooja 202 2 S2 XYZ Inc
9 ne 21 08-02
987654321 ABC 12345678 2023-
101 Dipson 203 Mouse 3 S1
0 Corp 90 08-01
998877665 Smartpho 09876543 2023-
103 Swastika 202 1 S2 XYZ Inc
5 ne 21 08-03
Functional dependencies (FDs) describe the relationship between columns, where one column
(or a set of columns) uniquely determines another column.
In our table, the composite primary key could be (OrderID, ProductID), as it uniquely
identifies each row.
To resolve these partial dependencies, we will split the table into separate tables:
Orders Table
Products Table
Suppliers Table
OrderDetails Table
At this point, the tables are in 2NF because there are no partial dependencies in any of the tables.
Let’s review each table to see if there are any transitive dependencies:
1. Orders Table:
o OrderID → CustomerName, CustomerPhone, OrderDate
o There are no transitive dependencies here because CustomerName,
CustomerPhone, and OrderDate directly depend on the primary key OrderID.
2. Products Table:
o ProductID → ProductName, SupplierID
oThere are no transitive dependencies here because ProductName and SupplierID
directly depend on ProductID.
3. Suppliers Table:
o SupplierID → SupplierName, SupplierPhone
There are no transitive dependencies here because SupplierName and
o
SupplierPhone directly depend on SupplierID.
4. OrderDetails Table:
o The composite primary key is (OrderID, ProductID), and Quantity depends
directly on both.
o There are no transitive dependencies here.
Since there are no transitive dependencies, all four tables are already in 3NF.
1. Orders Table
2. Products Table
4. OrderDetails Table
Summary
• 1NF: The table had atomic values and no repeating groups, so it was already in 1NF.
• 2NF: We removed partial dependencies by splitting the table into Orders, Products,
Suppliers, and OrderDetails.
• 3NF: We confirmed there were no transitive dependencies, so no further changes were
needed.
Original Table
To achieve 2NF, we need to remove partial dependencies. Our composite primary key is
(EmpID, ProjectID).
Employees Table
Projects Table
ProjectID ProjectName ProjectManager ManagerPhone
101 Website Manish 9876543210
102 Training Chadani 9123456789
103 Audit Reshma 9988776655
Assignments Table
EmpID ProjectID
1 101
2 102
3 102
4 103
1 103
Employees Table
Projects Table
ProjectManager ManagerPhone
Manish 9876543210
Chadani 9123456789
Reshma 9988776655
Assignments Table
EmpID ProjectID
1 101
2 102
3 102
4 103
1 103