Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 13

Database

Normalization
Third Normal Form

M.Z.M.Hassaan
BSc in ICT, CIMA, PGDE
Third Normal Form
(3NF)
A database s in third normal form if it satisfies
the following conditions.

– It should be in the Second Normal form.

– And it should not have Transitive Dependency.


Third Normal Form

What is Transitive Dependency?

Transitive Dependency is When a non-prime


attribute depends on other non-prime attributes
rather than depending upon the prime
attributes or primary key.
Just Think of this
• We Have 3 Attributes.

X,Y,Z
X Y Y Depends on X
Y Z Z Depends on Y Then
X Z Via Y
Third Normal Form

Note

So in Transitive Dependency a non-Key


attribute may depends on primary attributes
Through another non-Key attribute.
Lets explain it using an example
Example
Toys Table

Toys ID Category ID Category Name Price


5600 101 Soft Toy 500
5601 202 Indoor 1000
5602 101 Soft Toy 650
5603 303 Outdoor 5500
5604 202 Indoor 1500
Example
Toys Table
Toys ID Category ID Category Name Price
5600 101 Soft Toy 500
5601 202 Indoor 1000
5602 101 Soft Toy 650
5603 303 Outdoor 5500
5604 202 Indoor 1500

When we consider the above table we can see Category ID depends on Toys
ID(Primary Key). We can also note that the Category Name depends on Category ID
So we can say Category Name depends on Toys ID(Primary Key) Via Category ID. This
is known as Transitive Dependency
So this table is not in 3NF
Example – Converting to 3NF
Toys Table
Toys ID Category ID Category Name Price
5600 101 Soft Toy 500
5601 202 Indoor 1000
5602 101 Soft Toy 650
5603 303 Outdoor 5500
5604 202 Indoor 1500

Take the two attributes which have the


Transitive Dependency and create a separate
table
Example – Converting to 3NF
Toys Table
Toys ID Category ID Category Name Price
5600 101 Soft Toy 500
5601 202 Indoor 1000
5602 101 Soft Toy 650
5603 303 Outdoor 5500
5604 202 Indoor 1500

Category ID Category Name Toys ID Price


Example
Toys Table
– Converting to 3NF
Toys ID Category ID Category Name Price
5600 101 Soft Toy 500
5601 202 Indoor 1000
5602 101 Soft Toy 650
5603 303 Outdoor 5500
5604 202 Indoor 1500

Category Table Toys Table


Category ID Category Name Toys ID Price
101 Soft Toy 5600 500
202 Indoor 5601 1000
303 Outdoor 5602 650
5603 5500
5604 1500
Example
Toys Table
– Converting to 3NF
Toys ID Category ID Category Name Price
5600 101 Soft Toy 500
5601 202 Indoor 1000
5602 101 Soft Toy 650
5603 303 Outdoor 5500
5604 202 Indoor 1500

Category Table Toys Table


Category ID Category Name Toys ID Price Category ID
101 Soft Toy 5600 500 101
202 Indoor 5601 1000 202
303 Outdoor 5602 650 101
5603 5500 303
5604 1500 202
Activity
Teacher ID Name Computer ID Computer
Brand
001 Indika 1005 HP
002 Shreeni 1002 HP
003 Gayathry 1003 Lenovo
004 Chanakya 1001 Dell
005 Thilini 1004 Dell
006 Paboda 1000 IBM
007 Irshard 1006 Acer
Thank you

End

You might also like