You are on page 1of 27

NORMALIZATION & TYPES OF

NORMALIZATION
1) DEFINE NORMALIZATION
Normalization can be defined as :-
 A process of organizing the data in database into multiple related
tables to avoid data redundancy
 It also reduces insertion anomaly, update anomaly & deletion anomaly.
 Data Redundancy increases size of database
 Normalization is not about eliminating redundancy but limiting it
Types of normalization

 First Normal Form (1NF)


 Second Normal Form (2NF)
 Third Normal Form (3NF)
First Normal Form (1NF)

First normal form enforces these criteria:

 Eliminate repeating groups in individual tables.


Rules of First Normal Form
Rule 1: Single Valued Attributes
Each column of your table should be single valued which means they should not contain
multiple values.

Rule 2: Attribute Domain should not change


In each column the values stored must be of the same kind or type.

Rule 3: Unique name for Attributes/Columns


This rule expects that each column in a table should have a unique name. This is to
avoid confusion at the time of retrieving data or performing any other operation on the
stored data.

Rule 4: Order doesn't matters


This rule says that the order in which you store the data in your table doesn't matter.
Rule number 1
Rule number 1
Rule number 2
Rule number 3
Rule number 3
Rule number 3
Rule number 4
Example of unnormalized form

Number Name Classes


001231 William Hartnell Information Systems,
Systems Analysis,
Data Communications
001232 Patrick Troughton Systems Analysis,
Data Communications
001233 Jon Pertwee OO Programming,
Systems Analysis,
Data Communications
001234 Tom Baker Systems Analysis,
Data Communications
Example of first normal form

Classes
Number Name
001231 William Hartnell Information Systems
001231 William Hartnell Systems Analysis
001231 William Hartnell Data Communications
001232 Patrick Troughton Systems Analysis
001232 Patrick Troughton Data Communications
001233 Jon Pertwee OO Programming
001233 Jon Pertwee Systems Analysis
001233 Jon Pertwee Data Communications
001234 Tom Baker Systems Analysis
001234 Tom Baker Data Communications
Class work

RefNo Name Address Status AccNo


345 C.J. Date 23, High Street Business 120768,
348973
543 F.D. Rolland 45, The Ash Domestic 987654
Business D.R. Howe 17, Low Street 675 745363,
678453,
348973
Class Work
Second Normal Form (2NF)

A table is said to be in 2NF if both the following conditions hold:


 Table is in 1NF (First normal form)
 No non-prime attribute is dependent on the proper subset of any candidate
key of table(There should be no Partial Dependency).
An attribute that is not part of any candidate key is known as non-prime
attribute.
SECOND NORMAL FORM

Table purchase detail  This table has a composite primary


key i.e. customer id, store id. The
Customer Store_id Sales Location non key attribute is location. In
_id this case location depends on store
1 1 70 Patna id, which is part of the primary
key.
1 3 50 Noida

2 1 80 Patna

3 2 50 Delhi

4 3 90 Noida
After decomposing it into second normal
form it looks like:

Table Purchase Table Store


Customer_id Store_id Sales Store_id Location
1 1 70 1 Patna
1 3 50 2 Delhi
2 1 80 3 Noida
3 2 50
4 3 90
Class work

score_id student_id subject_id marks teacher

1 10 1 70 Java Teacher

2 10 2 75 C++ Teacher

3 11 1 80 Java Teacher
Class work

RefNo Name Address Status AccNo


345 C.J. Date 23, High Street Business 120768
345 C.J. Date 23, High Street Business 348973
543 F.D. Rolland 45, The Ash Domestic 987654
675 D.R. Howe 17, Low Street Business 745363
675 D.R. Howe 17, Low Street Business 678453
675 D.R. Howe 17, Low Street Business 348973
Class Work

Supplier# Part# City Quantity


S1 P1 London 1000
S1 P2 London 1500
S1 P3 London 3400
S1 P4 London 2100
S2 P2 Paris 3400
S2 P3 Paris 1000
S4 P1 Nuku alofa 5
S4 P4 Nuku alofa 7
Third Normal Form (3NF)

A table design is said to be in 3NF if both the following conditions hold:


 Table must be in 2NF
Transitivefunctional dependency of non-prime attribute on any super key should
be removed.
An attribute that is not part of any candidate key is known as non-prime attribute.
In other words 3NF can be explained like this: A table is in 3NF if it is in 2NF and for
each functional dependency X-> Y at least one of the following conditions hold:
 X is a super key of table
 Y is a prime attribute of table
An attribute that is a part of one of the candidate keys is known as prime attribute.
THIRD NORMAL FORM

Table Book Details  In the table, book_id determines


genre_id and genre_id determines
Bood_id Genre_id Genre Price genre type. Therefore book_idd
type determines genre type via genre_id
1 1 Fiction 100 and we have transitive functional
dependency.
2 2 Sports 110

3 1 Fiction 120

4 3 Travel 130

5 2 sports 140
After decomposing it into third normal
form it looks like:

TABLE BOOK TABLE GENRE


Book_id Genre_id Price Genre_id Genre type
1 1 100 1 Fiction
2 2 110 2 Sports
3 1 120 3 Travel
4 3 130
5 2 140
Class Work
Classwork

Branch Address Manager Acc Balance Type


Name No
No

Rathmines 15 Upr 1234 1205 -£123.45 ‘D’


Rathmimes Road
Rathmines 15 Upr 1234 6784 £67.54 ‘C’
Rathmimes Road
Rathmines 15 Upr 1234 9843 £43.43 ‘C’
Rathmimes Road
Dame St. 1 Dame Street 1101 5422 £34.50 ‘C’
Dame St. 1 Dame Street 1101 0998 £666.66 ‘D’

You might also like