Professional Documents
Culture Documents
ASSIGNMENT NO 04 DB
ASSIGNMENT NO 04 DB
ASSIGNMENT NO 04
Submitted to:
DR. MADIHA
Submitted by:
MOHSIN IDREES
SP21-BAI-014
Consider the following unnormalized tables and normalize them up to 4rth normal form. Provide complete
details about the normalization steps while converting from one normalize form to the next normal form. State
all dependencies and anomalies if exists in each step.
1. Employee/Department data:
Anomalies:
Repeating groups of Time Card No, Time Card Date, and Dept No, Dept Name for the same employee
To bring the table to 1NF, we need to remove the repeating groups. We split the table into two separate
tables: Employee and Time Card. The Employee table will contain information about employees, and the Time
Card table will store information about the time cards.
Table: Employee:
Functional Dependencies:
Employee(Emp No) -> Employee Name, Dept No, Dept Name
Time Card(Emp No) -> Time Card No, Time Card Date
Both tables already meet the requirements of 2NF, as there are no partial dependencies.
To remove the transitive dependency in the Employee table, we split it into two separate tables: Employee and
Department. The Employee table will contain information about employees, and the Department table will
store information about departments.
Table:Employee:
Table:Department:
All the tables already meet the requirements of BCNF, as there are no non-trivial dependencies on candidate
keys.
The tables are now in 4th Normal Form, and they are free from functional dependencies, anomalies, and
normalization issues.
2. Player data:
Anomalies:
Repeating groups of Phone, Average, Team, Team_colors, and Team_sponsor for the same player
To bring the table to 1NF, we need to remove the repeating groups. We split the table into two separate
tables: Player and Team.
Table: Player:
Table: Team:
Table: Player:
To remove the transitive dependency in the Player table, we split it into two separate tables: Player and
Player_Team.
Table: Player:
Table: Player_Team:
Player Team
Bill Smith Thunderheads
Cindy Blau Thunderheads
Anne Kellehan Stratospheres
Bill Altmeter Stratospheres
Andy Power Thunderheads
Johnson Mark Stratospheres
Diane Rose Thunderheads
David Grace Stratospheres
April Sprague Typhoons
Cecilia Grand Typhoons
Jack Klopp Typhoons
Table: Team:
All the tables already meet the requirements of BCNF, as there are no non-trivial dependencies on
candidate keys.
Anomalies:
Repeating groups of Course_Name, Teacher_Name, Name, System_Used, Hourly_Rate, and Total_Hrs
for the same Course Code and RollNo
To bring the table to 1NF, we need to remove the repeating groups. We split the table into two separate
tables: Course and Enrollment.
Table: Course:
Table: Enrolment:
Table: Course:
Course Code Course Name Teacher Name
C1 Visual Basic ABC
C2 Oracle&Dev DEF
C3 C++ KJP
C4 Java Kumar
Table: Enrolment
RollNo Course Code Name System Used Hourly Rate
100 C1 A1 P-I 20
101 C1 A2 P-II 30
102 C1 A3 Celeron 10
103 C1 A4 P.IV 40
104 C2 A5 P-I 20
105 C2 A6 P-III 35
106 C3 A7 P-II 30
107 C3 A8 P.IV 40
108 C3 A9 P-IV 40
109 C4 A10 P.I 20
109 C4 A10 Cyrix 20
To remove the transitive dependency in the Enrolment table, we split it into two separate
tables: Enrolment and Course_Details.
Table: Enrolment:
RollNo Course Code Name System Used Hourly Rate Total Hrs
100 C1 A1 P-I 20 7
101 C1 A2 P-II 30 3
102 C1 A3 Celeron 10 6
103 C1 A4 P.IV 40 1
104 C2 A5 P-I 20 7
105 C2 A6 P-III 35 3
106 C3 A7 P-II 30 2
107 C3 A8 P.IV 40 3
108 C3 A9 P-IV 40 2
109 C4 A10 P.I 20 1
109 C4 A10 Cyrix 20 2
Table: Course_Details:
All the tables already meet the requirements of BCNF, as there are no non-trivial dependencies on
candidate keys.
Anomalies:
Repeating groups of Product_Name, Product_Type ID, Product_Type, Bore_Diameter_inches,
Product_Rating, Unit_Selling_Price, Supplier_ID, Supplier_Name, Supplier_On_Time_Delivery_Score,
Warehouse_Number, Warehouse_Phone_Number, Product_Location_in_Warehouse, and
Quantity_In_Stock for the same Product Number
To bring the table to 1NF, we need to remove the repeating groups. We split the table into two separate
tables: Product and Supplier.
Table: Product:
Table: Supplier:
Both the tables already meet the requirements of 2NF, as non-key attributes depend on the entire
primary key.
To eliminate the transitive dependencies, we create separate tables for Product Type and Supplier.
Table: Product_Type:
Product_Type_ID Product_Type
1 Round Bore
2 Square Bore
3 Hex Bore
Table: Supplier:
Supplier_ID Supplier_Name Supplier_On_Time_Delivery_Score
ROWT Row Ten 97.0
SFAB Steel Fab 90.0
SPW Spin Works 85.0
BORE Borelt 97.0
BTECH Bore Tech 91.0
Table: Product:
Table: Product_Type:
Product_Type_ID Product_Type
1 Round Bore
2 Square Bore
3 Hex Bore
Table: Supplier:
Supplier_ID Supplier_Name Supplier_On_Time_Delivery_Score
ROWT Row Ten 97.0
SFAB Steel Fab 90.0
SPW Spin Works 85.0
BORE Borelt 97.0
BTECH Bore Tech 91.0