NORMALIZATION, Need for normalization-34slides.PPT
VanshGumber
15 views
34 slides
Mar 05, 2025
Slide 1 of 34
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
About This Presentation
Normalization
Size: 278.72 KB
Language: en
Added: Mar 05, 2025
Slides: 34 pages
Slide Content
NORMALIZATION
NORMALIZATION
Normalization is a method of breaking
down complex table structures into
simple table structures by using
certain rules.
It is a process of refining data model
built by E-R diagram.
We can reduce redundancy in a table.
Eliminate problems of inconsistency.
NEED FOR NORMALIZATION
Improves database design.
Ensure minimal redundancy.
To make relation simple and easier.
To increase performance of a system.
TYPES OF NORMALIZATION
First Normal Form (1NF)
Second Normal Form (2NF)
Third Normal Form (3NF)
Boyce – codd Normal Form (BCNF)
Fourth Normal Form (4NF)
Fifth Normal Form (5NF)
First , Second and Third Normal Forms were
defined by Dr. E.F.Codd.
FIRST NORMAL FORM
It contain no repeating groups.
A table is said to be in 1NF when each cell
of table contain only one value.
The Definition of 1NF has been expressed in
following two terms:
In every tuple of relation R, no attribute
should have repeating groups.
In every tuple of relation R , each attribute
must have a value and that too atomic value.
TABLE PROJECT
ECODEDEPTPROJ
CODE
HOUR
S
E 101 SystemP27
P51
P20
90
101
60
E 305 SalesP27 109
E 508 AdminP51
P27
NULL
72
TO BRING AN UNNORMALIZED
RELATION INTO 1NF,PERFORM
FOLLOWING STEPS:
Remove all the repeating groups from
the relation.
Decompose non-atomic attributes to
atomic attributes.
By applying 1NF, we arrive the
following table.
ECODE DEPT PROJCODE HOU
RS
E 101 SystemsP 27 90
E 101 SystemsP 51 101
E 101 SystemsP 20 60
E 305 Sales P 27 10
E 508 Admin P 51 Null
E 508 Admin P 27 72
ANOMALIES IN 1NF
INSERT: we can’t insert the information about
any projcode until the person join any dept.
UPDATE : If the ECODE is to be modified,it
has to be changed throughout the
table.Missing out even single correction
would result inconsistency.
DELETE: If information related to a specific
column is to be deleted, the entire row has to
be deleted which results in loss of required
information.
SECOND NORMAL FORM
Second normal form is based in
concept of fully functional dependency.
A relation that is in first normal form and
all it’s non key fields are fully dependent
upon whole key.
Consider a table :
ECodeProjcodedept hours
E 101P27 System90
E 305P27 Finance10
E 508P51 AdminNull
E 101P51 System101
E 101P20 System60
E 508P27 admin72
This could lead to following
problems:
INSERT : The dept. of a particular employee
can’t be recorded until the employee is assigned
a project.
UPDATE : The employee code and dept. are
repeated many times.hence if employee is
transferred to another dept. this change will have
to recorded in every row of table.
DELETE : If employee complete work on a
project ,the employee’s record will be
deleted.The information related to the dept. to
which the employee belongs will also be lost.
Guidelines for converting a table
into 2NF
Find and remove attributes that are
functionally dependent on only a part of
a key not on whole key.place them in a
different table.
Group the remaining attributes.
Employee Dept
ECODE DEPT
E101 Systems
E305 Sales
E508 Admin
THIRD NORMAL FORM
A relation that is in 1
st
and 2
nd
normal
form and every non key attributes are
functionally dependent only on primary
key.
Ecod
e
Dept DeptHead
E101 Systems E901
E305 Finance E905
E402 Sales E906
E508 Admin E908
E807 Finance E909
E608 Finance E909
The following problem arises:
INSERT : The dept head of a new dept that does
not have any employee at present cannot be
entered in dept head column because primary key
is unknown.
UPDATE : The code for a particular dept head is
repeated several times.if dept head is moved to
another dept ,the change will have to made
consistently across the table.
DELETE : If record of employee is deleted ,the
information regarding head will also be
deleted.There will be loss of information.
Guidelines for converting table
into 3NF:
Find and remove non-key attribute that
are functionally dependent on attributes
that are not the primary key.place them
in a different table.
Group the remaining attributes.
Department
Dept Dept Head
Systems E901
Sales E906
Admin E908
finance E909
BOYCE-CODD NORMAL
FORM
The 3NF was not satisfactory for some
tables:
That had multiple candidate keys.
Where the multiple candidate keys were
composite.
Where multiple candidate keys
overlapped(one attribute common).
BCNF:
A relation is in the BCNF if and only if
every determinant is a candidate
key.Here determinant is a single
attribute or composite attribute on which
some other attribute is fully functionally
dependent.
Guidelines for converting a table
into BCNF:
Find and remove overlapping candidate
keys.place the part of candidate key
and the attribute it is functionally
dependent.
Group the remaining items into a table.
STUDENT,SUBJECT,TEACHER
STUDENT SUBJECT TEACHER
Ajay
Ajay
Kumar
Kumar
Math
Physics
Math
Physics
Prof.White
Prof.Green
Prof.White
Prof.Neha
ANOMOLIES OF
BCNF:
If we wish to delete the
information that kumar is
study physics, we can’t do
so without loosing the
information that prof. Neha
teaches English.
Removal of
anomalies of BCNF
In order to make candidate
key teacher must be
candidate key.so original table
is break down to two table
1.(Student,Teacher)
2.(Teacher,subject)
FOURTH NORMAL FORM
A relation is said to be fourth normal
form(4NF) if and only if it is in third
normal or Boyce-Code Normal form and
it must have almost one or it should not
have more than one multivalued
dependency.
COURSE-STUDENT-BOOK
COURSE STUNAMETEXT-BOOK
PHYSICS
PHYSICS
PHYSICS
PHYSICS
CHEMISTRY
CHEMISTRY
ENGLISH
ENGLISH
ANKIT
ANKIT
RAHAT
RAHAT
ANKIT
ANKIT
RAJ
RAJ
MECHANICS
OPTICS
MECHANICS
OPTICS
O.C
I.C
ENGLISH
ENGLISH
RULE TO TRANSFER A RELATION
INTO FOURTH NORMAL FORM
COURSE-STUDENT
COURSE-
STUDENT
STUDENT-
NAME
PHYSICS
PHYSICS
CHEMISTRY
ENGLISH
ANKIT
RAHAT
ANKIT
RAJ
COURSE-BOOK
SUBJECT-
NAME
TEXT-BOOK
PHYSICS
PHYSICS
CHEMISTRY
CHEMISTRY
ENGLISH
ENGLISH
MECHANICS
OPTICS
O.CHEMISTRY
ING CHEMISTRY
ENGLISH
ENGLISH
FIFTH NORMAL FORM
A relation is said to be in 5
th
normal form
if it is in 4nf .
It cannot be further non-loss
decomposed.