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

Normalization

DR. MAGDY ABDULGHANY


What is Normalization ?

Database normalization is a technique for designing


relational database tables to minimize duplication of
information and, in so doing, to safeguard the
database against certain types of logical or structural
problems, namely data anomalies.

to avoiding duplicate data and easy maintence it


depends on entity relationship between columns
Comprehensive Example contains 1NF,2NF and 3NF

Cost Days Type Vedio_Name Vedio City Phone Customer Customer_ID Date Receipt
_ID _Name
3.00 1 N Al-Resalah 325 Makkah 45678932 Ali 226 9/1/2008 1000

2.50 2 H Salah Addein 548 Makkah 45678932 Ali 226 9/1/2008 1000

2.50 2 H Haron AL- 6437 Makkah 45678932 Ali 226 9/1/2008 1000
Rashed
3.00 1 N Al-Resalah 325 Jeddah 7654321 Omar 224 9/4/2008 1001

2.50 2 H Haron AL- 6437 Jeddah 7654321 Omar 224 9/4/2008 1001
Rashed
3.00 1 N Islam Today 468 Makkah 45678932 Ali 226 10/2/2008 1002

* To get 1NF (Remove the Repeating groups)


City Phone Customer_Name Customer_ID Date Receipt

Makkah 45678932 Ali 226 9/1/2008 1000

Jeddah 7654321 Omar 224 9/4/2008 1001

Makkah 45678932 Ali 226 10/2/2008 1002

Table 1
Cost Days Type Vedio_Name Vedio _ID Receipt

3.00 1 N Al-Resalah 325 1000

2.50 2 H Salah Addein 548 1000

2.50 2 H Haron AL-Rashed 6437 1000

3.00 1 N Al-Resalah 325 1001

2.50 2 H Haron AL-Rashed 6437 1001

3.00 1 N Islam Today 468 1002

Table 2
Connection between table 1 & table 2?

 Table1 (Receipt, Date, Customer_ID, Customer_Name, Phone, City)

 Table2(Receipt, Vedio_ID, Vedio_Name, Type, Days, Cost)

* To get 2NF (Identify & Remove Partial FD)


• Table 2 : Table3, Table4
• Vedio_ID ----- [ Vedio_Name, Type, Days, Cost]

Cost Days Type Vedio_Name Vedio_ID

3.00 1 N Al-Resalah 325

2.50 2 H Salah Addein 548

2.50 2 H Haron AL-Rashed 6437

3.00 1 N Islam Today 468

Table 3
Vedio_ID Receipt

325 1000

548 1000

6437 1000

325 1001

6437 1001

468 1002

Table 4
* To get 3NF (First Step – From table1) ---[ Table5,Table6]
• Table1 ( Receipt, Date, Customer_ID, Customer_Name, Phone,City)
• Customer_ID -----[Customer_Name, Phone,City].
City Phone Customer_Nam Customer_ID
e
Makkah 45678932 Ali 226

Jeddah 7654321 Omar 224

Table 5
Customer_ID Date Receipt

226 9/1/2008 1000

224 9/4/2008 1001

226 10/2/2008 1002

Table 6
• (Second Step – From table3)

Cost Days Type Vedio_Name Vedio_ID

3.00 1 N Al-Resalah 325

2.50 2 H Salah Addein 548

2.50 2 H Haron AL-Rashed 6437

3.00 1 N Islam Today 468

 Vedio_ID ---[Vedio_Nmae]
 Vedio_ID---[Type]
 Type---[Days,cost]
 From table3 :- Table7, Table8
Type Vedio_Name Vedio_ID

N Al-Resalah 325

H Salah Addein 548

H Haron AL-Rashed 6437

N Islam Today 468

Table 7
Type Cost Days

N 3.00 1

H 2.50 2

Table 8

You might also like