In: Computer Science
Normalize the following table into 1NF, 2NF and 3NF.
Salesperson name |
Sales area |
Customer Number |
Customer Name |
Warehouse Number |
Warehouse Location |
Sales Amount |
|
76458 |
Hariharan |
East |
17658 |
Asani |
3 |
Govandi |
13545 |
17645 |
Madhuram |
6 |
Vasai |
10600 |
|||
17623 |
Sumit |
6 |
Vasai |
9700 |
|||
76567 |
Dheerendra |
North |
18190 |
Dhanram |
4 |
Thane |
11560 |
18173 |
Toshi |
4 |
Thane |
2590 |
|||
18150 |
Ganesh |
1 |
Kalyan |
8090 |
Three Steps of Normalization
Step 1: Flatten the relation, i.e., get rid of composite
attributes and multi-valued attributes --> 1NF
Step 2: Remove partial key dependencies --> 2NF
Step 3: Remove nonkey dependencies --> 3NF
__________________________________________________________________
Step 1: Flatten the relation --> 1NF
To convert to first-normal form is easy, simply combine each row in the non-simple column with the items in the other columns to make a row in the 1NF table:
SalesPerson No. | SalesPerson- NAME | S-Area | Customer No. | Customer Name | WareHouse No. | Warehose Location | Sales Amount |
76458 | Hariharan | East | 17658 | Asani | 3 | Govandi | 13545 |
17645 | Madhuram | ||||||
17623 | Sumit | ||||||
76567 | Dheerendra | North | 18190 | Dhanram | 4 | Thane | 11560 |
18173 | Toshi | ||||||
18150 | Ganesh |
___________________________________________________________________________________
Step 2: Remove partial key dependencies --> 2NF The key of the previous table: Salesperson-No, Customer-No Salesperson-No --> Salesperson-Name Salesperson-No --> S-Area So split the SALES-REPORT table into two tables SALESPERSON (Salesperson-No, Salesperson-name, Sales-area), and SALESPERSON-CUSTOMER (Salesperson-No, Customer-No, Customer-name, Warehouse-No, Warehouse-loc, Sales-amount) SALESPERSON table Salesperson-No Salesperson-name Sales-area ------------------------------------------ 76458 Hariharan East 76567 Dheerendra North etc. ------------------------------------------- SALESPERSON-CUSTOMER table Sp-No C-No C-Name W-No Warehouse-loc Sales
76458 | 17658 | Asani | 3 | Govandi | 13545 |
76567 | 18190 | Dhanram | 4 | Thane | 11560 |
__________________________________________________________________________________________
Step 3: Remove non-key dependencies --> 3NF
So, to convert it to 3NF form split the table into 4 3NF relations:
SALES-REPORT (Salesperson-No, Salesperson-Name, Sales-Area, (Customer-No, Customer-Name, Warehouse-No, Warehouse-location, Sales)*) SALESPERSON (Salesperson-No, Salesperson-name, Sales-area) SALES (Salesperson-number, Customer-number, Sales-amount) CUSTOMER (Customer-number, Customer-name, Warehouse-number)
___________________________________________________________________________________
*Please Check the Table provided by you . Values of Sales areea , customer number and customer name are incorrect and not upto the data type. Give the correct table and comment for any clarification needed.