0% found this document useful (0 votes)
25 views2 pages

Lab 9-Solution Vu

The document describes converting a relation into third normal form (3NF) by removing a transitive dependency. The given relation contains customer, salesman and region data. It is decomposed into two new relations, one containing customer, name and salesman, and the other containing salesman and region, removing the transitive dependency and achieving 3NF.

Uploaded by

malikjavaid093
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views2 pages

Lab 9-Solution Vu

The document describes converting a relation into third normal form (3NF) by removing a transitive dependency. The given relation contains customer, salesman and region data. It is decomposed into two new relations, one containing customer, name and salesman, and the other containing salesman and region, removing the transitive dependency and achieving 3NF.

Uploaded by

malikjavaid093
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Lab 9

Normalization (3NF)
(Solution)

Problem Statement:
Following relation is already in Second Normal Form. You are required to convert it into
Third Normal Form using the techniques you have studied so far.
CustomerID Name SalesMan Region
11 Hamza Khalid South
21 Shoaib Umair West
31 Shahbaz khalid South
44 Salman Zulfiqar East
51 Rizwan Umair West
61 Farooq Uzair North

The relation can be expressed in a shorthand notation as follows:


SALES (CustomerID, Name, SalesMan, Region)
The attribute CustomerID is used as primary key. Each salesman is assigned a unique region.
The above relation contains the following functional dependencies:
CustomerID Name, SalesMan
SalesMan Region
The above relation is in 2NF because the primary key consists of single attribute. A transitive
dependency exists in the relation. The Region (a non-key attribute) is dependent on another
non-key attribute (SalesMan) and SalesMan is functionally dependent on CustomerID. It
means that region is transitively dependent on CustomerID.

Solution:
Transitive dependency exists if a non-key attribute depends on any other non-key attribute.
The transitive dependency can be removed by decomposing the above relation into two
relations as follows:
CustomerID Name SalesMan
11 Hamza Khalid
21 Shoaib Umair
31 Shahbaz khalid
44 Salman Zulfiqar
51 Rizwan Umair
61 farooq Uzair
SALES (CustomerID, Name, SalesMan)

SalesMan Region
Khalid South
Umair West
Zulfiqar East
Uzair North

SALESMAN (SalesMan, Region)

Both relations are now in 3NF. There is no transitive dependency in these relations.
The determinant attribute in transitive dependency becomes the primary key in SALESMAN
relation.

Mechanism to Conduct Lab:


Lab will be conducted via Google Meet / Zoom.

You might also like