Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 15

Data Base Systems (CSC402)

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:

Step 1: 1st Normal Form (1NF):


In the 1st Normal Form, we eliminate repeating groups and ensure atomicity of values. Looking at the provided
table, we can identify the following functional dependencies and anomalies:
Functional Dependencies:
 Emp No -> Employee Name
 Time Card No -> Time Card Date
 Dept No -> Dept Name

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:

Emp No Employee Name Dept No Dept Name


10 Thomas Arquette 20 Marketing
99 Janice Smitty 10 Accounting
500 Alan Cook 50 Shipping
700 Ernest Gold 50 Shipping
Table: Time Card:

Emp No Time Card No Time Card Date


10 106 11/02/2002
10 106 11/02/2002
10 106 11/02/2002
10 115 11/09/2002
500 107 11/02/2002
500 107 11/02/2002
700 108 11/02/2002
700 116 11/09/2002
700 116 11/09/2002

Step 2: 2nd Normal Form (2NF):


In the 2nd Normal Form, we eliminate partial dependencies. Looking at the tables after 1NF, we can identify
the following functional dependencies:

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.

Step 3: 3rd Normal Form (3NF):


In the 3rd Normal Form, we eliminate transitive dependencies. Looking at the tables after 2NF, we can identify
the following functional dependencies:
Functional Dependencies:
 Employee(Emp No) -> Employee Name
 Employee(Dept No) -> Dept Name
 Time Card(Emp No) -> Time Card No, Time Card Date

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:

Emp No Employee Name


10 Thomas Arquette
99 Janice Smitty
500 Alan Cook
700 Ernest Gold

Table:Department:

Dept No Dept Name


20 Marketing
10 Accounting
50 Shipping
Table: Time Card:

Emp No Time Card No Time Card Date


10 106 11/02/2002
10 106 11/02/2002
10 106 11/02/2002
10 115 11/09/2002
500 107 11/02/2002
500 107 11/02/2002
700 108 11/02/2002
700 116 11/09/2002
700 116 11/09/2002

Step 4: Boyce-Codd Normal Form (BCNF):


In BCNF, we ensure that there are no non-trivial dependencies on a candidate key. Looking at the tables after
3NF, we can identify the following functional dependencies:
Functional Dependencies:
 Employee(Emp No) -> Employee Name
 Department(Dept No) -> Dept Name
 Time Card(Emp No) -> Time Card No, Time Card Date

All the tables already meet the requirements of BCNF, as there are no non-trivial dependencies on candidate
keys.

Step 5: 4th Normal Form (4NF):


In the 4th Normal Form, we eliminate multivalued dependencies. Looking at the tables after BCNF, there are
no multivalued dependencies present. Therefore, no further normalization is required.
Final Normalized Tables:
Employee(Emp No, Employee Name)
Department(Dept No, Dept Name)
Time Card(Emp No, Time Card No, Time Card Date)

The tables are now in 4th Normal Form, and they are free from functional dependencies, anomalies, and
normalization issues.
2. Player data:

Step 1: 1st Normal Form (1NF):


In the 1st Normal Form, we eliminate repeating groups and ensure atomicity of values. Looking at the
provided table, we can identify the following functional dependencies and anomalies:
Functional Dependencies:
 Player -> Phone, Average, Team, Team_colors, Team_sponsor

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:

Player Phone Average Team


Bill Smith 995-0987 14 Thunderheads
Cindy Blau 877-2377 17 Thunderheads
Anne Kellehan 271-3444 12 Stratospheres
Bill Altmeter 271-8850 19 Stratospheres
Andy Power 2714401 11 Thunderheads
Johnson Mark 995-0906 14 Stratospheres
Diane Rose 822-0841 20 Thunderheads
David Grace 822-4818 10 Stratospheres
April Sprague 995-0741 13 Typhoons
Cecilia Grand 822-8402 9 Typhoons
Jack Klopp 822-5523 14 Typhoons

Table: Team:

Team Team Colors Team Sponsor


Thunderheads Blue and gold Albert's Photo
Stratospheres Red and white Things R Us
Typhoons Dark gray Better Boots

Step 2: 2nd Normal Form (2NF):


In the 2nd Normal Form, we eliminate partial dependencies. Looking at the tables after 1NF, we can
identify the following functional dependencies:
Functional Dependencies:
 Player(Player) -> Phone, Average, Team

To remove the partial dependency, we keep the Player table as it is.

Table: Player:

Player Phone Average Team


Bill Smith 995-0987 14 Thunderheads
Cindy Blau 877-2377 17 Thunderheads
Anne Kellehan 271-3444 12 Stratospheres
Bill Altmeter 271-8850 19 Stratospheres
Andy Power 2714401 11 Thunderheads
Johnson Mark 995-0906 14 Stratospheres
Diane Rose 822-0841 20 Thunderheads
David Grace 822-4818 10 Stratospheres
April Sprague 995-0741 13 Typhoons
Cecilia Grand 822-8402 9 Typhoons
Jack Klopp 822-5523 14 Typhoons

Step 3: 3rd Normal Form (3NF):


In the 3rd Normal Form, we eliminate transitive dependencies. Looking at the tables after 2NF, we can
identify the following functional dependencies:
Functional Dependencies:
 Player(Player) -> Phone, Average
 Team(Team) -> Team_colors, Team_sponsor

To remove the transitive dependency in the Player table, we split it into two separate tables: Player and
Player_Team.

Table: Player:

Player Phone Average


Bill Smith 995-0987 14
Cindy Blau 877-2377 17
Anne Kellehan 271-3444 12
Bill Altmeter 271-8850 19
Andy Power 2714401 11
Johnson Mark 995-0906 14
Diane Rose 822-0841 20
David Grace 822-4818 10
April Sprague 995-0741 13
Cecilia Grand 822-8402 9
Jack Klopp 822-5523 14

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:

Team Team Colors Team Sponsor


Thunderheads Blue and gold Albert's Photo
Stratospheres Red and white Things R Us
Typhoons Dark gray Better Boots

Step 4: Boyce-Codd Normal Form (BCNF):


In BCNF, we ensure that there are no non-trivial dependencies on a candidate key. Looking at the tables
after 3NF, we can identify the following functional dependencies:
Functional Dependencies:
 Player(Player) -> Phone, Average
 Team(Team) -> Team_colors, Team_sponsor

All the tables already meet the requirements of BCNF, as there are no non-trivial dependencies on
candidate keys.

Step 5: 4th Normal Form (4NF):


In the 4th Normal Form, we eliminate multivalued dependencies. Looking at the tables after BCNF, there are
no multivalued dependencies present. Therefore, no further normalization is required.
Final Normalized Tables:
Player(Player, Phone, Average)
Player_Team(Player, Team)
Team(Team, Team_colors, Team_sponsor)
3.Course/system utilization data:

Step 1: 1st Normal Form (1NF):


In the 1st Normal Form, we eliminate repeating groups and ensure atomicity of values. Looking at the
provided table, we can identify the following functional dependencies and anomalies:
Functional Dependencies:
 Course Code -> Course_Name, Teacher_Name
 RollNo -> Name, System_Used, Hourly_Rate, Total_Hrs

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:

Course Code Course Name Teacher Name


C1 Visual Basic ABC
C2 Oracle&Dev DEF
C3 C++ KJP
C4 Java Kumar

Table: Enrolment:

RollNo Name System Used Hourly Rate Total Hrs


100 A1 P-I 20 7
101 A2 P-II 30 3
102 A3 Celeron 10 6
103 A4 P.IV 40 1
104 A5 P-I 20 7
105 A6 P-III 35 3
106 A7 P-II 30 2
107 A8 P.IV 40 3
108 A9 P-IV 40 2
109 A10 P.I 20 1
109 A10 Cyrix 20 2

Step 2: 2nd Normal Form (2NF):


In the 2nd Normal Form, we eliminate partial dependencies. Looking at the tables after
1NF, we can identify the following functional dependencies:
Functional Dependencies:
 Course Code -> Course_Name, Teacher_Name

To remove the partial dependency, we keep the Course table as it is.

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

Step 3: 3rd Normal Form (3NF):


In the 3rd Normal Form, we eliminate transitive dependencies. Looking at the tables after
2NF, we can identify the following functional dependencies:
Functional Dependencies:
 Course Code -> Course_Name, Teacher_Name

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:

Course Code Course Name Teacher Name


C1 Visual Basic ABC
C2 Oracle&Dev DEF
C3 C++ KJP
C4 Java Kumar

Step 4: Boyce-Codd Normal Form (BCNF):


In BCNF, we ensure that there are no non-trivial dependencies on a candidate key. Looking at the tables
after 3NF, we can identify the following functional dependencies:
Functional Dependencies:
 Course Code -> Course_Name, Teacher_Name

All the tables already meet the requirements of BCNF, as there are no non-trivial dependencies on
candidate keys.

Step 5: 4th Normal Form (4NF):


In the 4th Normal Form, we eliminate multivalued dependencies. Looking at the tables after BCNF, there
are no multivalued dependencies present. Therefore, no further normalization is required.
Final Normalized Tables:
Course(Course Code, Course_Name, Teacher_Name)
Enrolment(RollNo, Course Code, Name, System_Used, Hourly_Rate, Total_Hrs)
4.Product/vendor data:

Step 1: 1st Normal Form (1NF):


In the 1st Normal Form, we eliminate repeating groups and ensure atomicity of values. Looking at the
provided table, we can identify the following functional dependencies and anomalies:
Functional Dependencies:
 Product Number -> 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,
Quantity_In_Stock

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:

Product_ Product Product_ Produc Bore_Diame Product Unit_Selli Quantity_


Number _Name Type_ID t_Type ter_inches _Rating ng_Price In_Stock
Disc Round
4ZZA11 Bearing 1 Bore 1.125 4 stars 78.23 57
Disc Round
4ZZA41 Bearing 1 Bore 1.125 5 stars 81.15 123
Disc Round
4ZZA41 Bearing 1 Bore 1.125 5 stars 81.15 49
Disc Round
4ZZA83 Bearing 1 Bore 1.25 5 stars 84.74 37
Disc Round
4ZZA83 Bearing 1 Bore 1.25 5 stars 84.74 112
Disc Round
4ZYU1O Bearing 1 Bore 1.25 4 stars 83.50 68
Disc Square
4TZB30 Bearing 2 Bore 1.125 4 stars 97.25 61
Disc Square
4TTA12 Bearing 2 Bore 1.125 5 stars 98.50 59
Disc Square
4TTA32 Bearing 2 Bore 1.25 5 stars 136.48 27
Disc Square
4TZC44 Bearing 2 Bore 1.25 4.2 stars 135.55 18
Disc Square
4TZB35 Bearing 2 Bore 1.50 4 stars 150.89 25
Disc Hex
4XXB52 Bearing 3 Bore 0.875 4 stars 43.70 135
Disc Hex
4XXB52 Bearing 3 Bore 0.875 4 stars 43.70 115
Insert Round
4ZXB57 Bearing 1 Bore 1.0 4.5 stars 22.15 97
Insert Round
4ZXB57 Bearing 1 Bore 1.0 4.5 stars 22.15 45
Insert Hex
4XRG58 Bearing 3 Bore 0.875 4 stars 45.00 101

Table: Supplier:

Suppli Supplier Supplier_On_Time_ Warehouse Warehouse_Ph Product_Location_


er_ID _Name Delivery_Score _Number one_Number in_Warehouse
ROWT Row Ten 97.0 1 555-6137 Aislo 12
SFAB Steel Fab 90.0 1 555-6137 Aislo 12
SFAB Steel Fab 90.0 2 555-8744 Aislo 12
SFAB Steel Fab 90.0 2 555-8744 Aislo 12
Spin
SPW Works 85.0 2 555-8744 Aislo 12
ROWT Row Ten 97.0 1 555-6137 Aislo 12
Spin
SPW Works 85.0 2 555-8744 Aislo 12
BORE Borelt 97.0 1 555-6137 Aislo 12
Spin
SPW Works 85.0 2 555-8744 Aislo 12
Bore
BTECH Tech 91.0 2 555-8744 Aislo 12

Step 2: 2nd Normal Form (2NF):


In the 2nd Normal Form, we ensure that non-key attributes depend on the entire primary key. Looking at
the tables after 1NF, we can identify the following functional dependencies:
Functional Dependencies:
 Product Number -> Product_Name, Product_Type ID, Product_Type, Bore_Diameter_inches,
Product_Rating, Unit_Selling_Price, Quantity_In_Stock
 Supplier ID -> Supplier_Name, Supplier_On_Time_Delivery_Score, Warehouse_Number,
Warehouse_Phone_Number, Product_Location_in_Warehouse

Both the tables already meet the requirements of 2NF, as non-key attributes depend on the entire
primary key.

Step 3: 3rd Normal Form (3NF):


In the 3rd Normal Form, we remove transitive dependencies. Looking at the tables after 2NF, we can
identify the following functional dependencies:
Functional Dependencies:
 Product Type ID -> Product Type
 Supplier ID -> Supplier_Name, Supplier_On_Time_Delivery_Score

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

Step 4: Boyce-Codd Normal Form (BCNF):


In BCNF, we ensure that there are no non-trivial dependencies on a candidate key. Looking at the tables
after 3NF, we can identify the following functional dependencies:
Functional Dependencies:
 No non-trivial dependencies exist in the tables.
Both the tables already meet the requirements of BCNF.

Step 5: 4th Normal Form (4NF):


In the 4th Normal Form, we handle multi-valued dependencies. However, there are no evident multi-
valued dependencies in the given tables, so they already meet the requirements of 4NF.
The final normalized tables are as follows:

Table: Product:

Product_ Product Product_ Produc Bore_Diame Product Unit_Selli Quantity_


Number _Name Type_ID t_Type ter_inches _Rating ng_Price In_Stock
Disc Round
4ZZA11 Bearing 1 Bore 1.125 4 stars 78.23 57
Disc Round
4ZZA41 Bearing 1 Bore 1.125 5 stars 81.15 123
Disc Round
4ZZA41 Bearing 1 Bore 1.125 5 stars 81.15 49
Disc Round
4ZZA83 Bearing 1 Bore 1.25 5 stars 84.74 37
Disc Round
4ZZA83 Bearing 1 Bore 1.25 5 stars 84.74 112
Disc Round
4ZYU1O Bearing 1 Bore 1.25 4 stars 83.50 68
Disc Square
4TZB30 Bearing 2 Bore 1.125 4 stars 97.25 61
Disc Square
4TTA12 Bearing 2 Bore 1.125 5 stars 98.50 59
Disc Square
4TTA32 Bearing 2 Bore 1.25 5 stars 136.48 27
Disc Square
4TZC44 Bearing 2 Bore 1.25 4.2 stars 135.55 18
Disc Square
4TZB35 Bearing 2 Bore 1.50 4 stars 150.89 25
Disc Hex
4XXB52 Bearing 3 Bore 0.875 4 stars 43.70 135
Disc Hex
4XXB52 Bearing 3 Bore 0.875 4 stars 43.70 115
Insert Round
4ZXB57 Bearing 1 Bore 1.0 4.5 stars 22.15 97
Insert Round
4ZXB57 Bearing 1 Bore 1.0 4.5 stars 22.15 45
Insert Hex
4XRG58 Bearing 3 Bore 0.875 4 stars 45.00 101

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

You might also like