Normalizatio PPT 4.2
Normalizatio PPT 4.2
Department of CSE
Supreme Knowledge Foundation Group of Institutions
Definition of Normalization: Normalization is a process to decompose an unsatisfactory relation (Table) into more
than one relation (Table) without loss of any data and to avoid data redundancy, updation anomaly, insertion anomaly and
deletion anomaly.
EMPLOYEE_DEPT
E_ID E_Name E_Addr D_No D_Name D_Loc
101 Manab Malda D01 Design Delhi
102 Aritro Hooghly D02 Acc. Kolkata
103 Koyel Kolkata D03 Mkt. Mumbai
Data
104 Sonali Hooghly D03 Mkt. Mumbai redundancy
F. Key
P. Key DEPT_INFO EMP_INFO
D_No# D_Name D_Loc E_ID# E_Name E_Addr D_No
D01 Design Delhi 101 Manab Malda D01
D02 Acc. Kolkata
102 Aritro Hooghly D02
D03 Mkt. Mumbai
103 Koyel Kolkata D03
104 Sonali Hooghly D03
P. Key
Types of Normalization and Some Important Terminologies related to Normal Forms:
Functional Dependency: An attribute is said to be functionally dependent on the other, if the value of one attribute
depends on or is determined by the value of other attribute of the same relation.
EMP
E_ID# E_NAME E_ADDR EMP.E_ID EMP.E_NAME E_ID E_NAME
101 Manab Kolkata EMP.E_ID EMP.E_ADDR
101 Manab
102 Sonali Hooghly
102 Sonali
(1)1ST Normal Form (1NF): A relation is in 1NF if and only if all the non-primary attributes are functionally dependent
on its primary key.
SALES_ORDER (R)
Ord_No# Date Cust_No Cust_Name Clk_No Clk_Name Item_No Item_Name Qty
(2) 2ND Normal Form (2NF): A relation is in 2NF if and only if it is in 1NF and every non-key attribute is fully
functionally dependent on its primary key.
ORDER_ITEM (R3) ITEM_INFO (R4)
Item_No# Item_Name
Ord_No# Item_No# Qty
405 007 5 005 Mouse
Ord_No# Date Cust_No Cust_Name Clk_No Clk_Name { Ord_No} { Cust_No} and { Cust_No } { Cust_Name }
i.e. { Ord_No} { Cust_Name }[ Transitive Dependency]
405 2/2/18 C01 MANAB 102 XYZ
{ Ord_No} { Clk_No} and { Clk_No } { Clk_Name } i.e.
406 3/4/18 C02 KOYEL 103 PQR
{ Ord_No} { Clk_Name }[ Transitive Dependency]
408 14/4/18 C05 AMITAVA 107 ABC
(3) 3RD Normal Form (3NF): A relation, R is in 3NF if and only if it is in 2NF and every non-key attribute of R is non-
transitively dependent(i.e. directly dependent) on every primary key.
AB A AB C
AB B AB D
AB AB
(4) Boyce Codd Normal Form(BCNF)/3.5 NF: A relation is in BCNF for the following conditions:
i. It is in 3NF. R10
Roll# Name Addr
ii. For every FD, X Y and Y ⊆ X, X should be the super key. 101 Manab KOL
STUDENT 102 Sayon MAL
Roll# Reg Name Addr R11
101 R205 Manab KOL Reg# Name Addr
102 R206 Sayon MAL R205 Manab KOL
Here, the Candidate Keys are-{Roll} and {Reg} R206 Sayon MAL
R12
Roll# Reg# {Roll,Reg} {Roll}
{Roll,Reg} {Reg}
101 R205 {Roll,Reg} {Roll,Reg}
102 R206
(5) 4TH Normal Form (4NF): A relation R, is in 4NF if and only if it satisfies the following condition:
i. It should be in BCNF.
ii. The Relation (Table) should not have any Multi-valued dependencies.
AUT_BOOK (R1) BOOK_PUB (R2) AUT_PUB (R3) These three relation are in 4NF
AID# Title# PID# Title# AID# PID#
A01 C++ P01 JAVA A01 P02
A01 JAVA P01 DBMS
A01 P01
P02 C++
A02 C++ A02 P02 NOTE: MVD( ) is a generalization
A03 JAVA of Functional Dependency
A03 P01
A03 DBMS
(6) 5TH Normal Form (5NF): A relation R, is in 5NF if and only if it satisfies the following condition:
The FDs are ISBN Price and ISBN Page for Decomposition-A A is Lossless Decomposition
R3 R4
ISBN# Price Page# Price ISBN# Price Page
09 25 800 25 09 25 800
01 22
⋈ 01 22 200
200 22
02 25 810 25 02 25 800
The FDs are ISBN Price and Page Price for Decomposition-B B is Lossy Decomposition
NOTE: A decomposition will be lossless, if it satisfies the following conditions:
i. Att(R1) Ս Att(R2) = Att(R)
ii. Att(R1) Ո Att (R2) ≠ Փ
iii. Att(R1) Ո Att (R2) Att(R1) or Att(R1) Ո Att (R2) Att(R2)
Armstrong’s Axioms:
Armstrong’s Axioms are defined as the inference rules for Functional Dependencies.
The set of all those attributes, which can be functionally determined from an attribute set is called as the closure of that
attribute set.
Exp: Consider a relation schema R(A, B,C,D,E,F) with the FDs A BC, BC DE and D F
A+ = {A}
= {A,B,C} [A BC]
= {A,B,C,D,E} [BC DE]
= {A,B,C,D,E,F} [D F] As all the attributes of the relation R is functionally determined on attribute A,
attribute A can be called as the Candidate Key.
Canonical Cover:
Canonical cover is the process to remove redundant functional dependencies (FDs) from a relation schema. It is
implemented for a set of functional dependencies (F) to optimal the FDs and is denoted by Fc.
Step-1: Use the union rule to replace any dependencies. [For uniqueness of L.H.S FDs]
Step-2: Find a functional dependency A B with an extraneous attribute either in A or B.
Step-3: If an extraneous attribute is found delete it from F (but it is to be kept in mind that F does not change).
2. We remove AB C (here AB is an extraneous attribute), because attribute C only depends on attribute B, so it never
depends on the composite attribute AB.
Now F = { A BC, B C }
3. C again is an extraneous attribute for A BC, because C can be determined by the attribute B. [here also A B is
logically implied by A B and B C ]
Hence, Fc. = { A B, B C } Reducible set of FDs (Canonical Cover)
Thanking You!!