You are on page 1of 24

NORMALIZATION

OF
DATABASE
The Need
• Illogically or inconsistently stored
data can cause a number of
problems.
• In a relational database, a logical
and efficient design is just as
critical.
• A poorly designed database may
provide erroneous information, may
be difficult to use, or may even fail
to work properly.
Definition
• The process of designing a relational database
includes making sure that a table contains
only data directly related to the primary key,
that each data field contains only one item of
data, and that redundant (duplicated and
unnecessary) data is eliminated.
• The task of a database designer is to structure
the data in a way that eliminates unnecessary
duplication(s) and provides a rapid search path
to all necessary information.
• This process of specifying and defining tables,
keys, columns, and relationships in order to
create an efficient database is called
normalization.
Normalization is part of successful database
design.
Without normalization, database systems
can be
inaccurate, slow, and inefficient
and they might not produce the data you
expect.
Un-Normal Form

• The database is said to be in an un-


normal form if there are repeating
group-of items in a data file.
Normal Forms

• We use the normalization process to


design efficient and functional
databases. By normalizing, we store
data where it logically and uniquely
belongs. The normalization process
involves a few steps and each step
is called a form.
I NF

2NF
3NF
BCNF
4NF
5NF
DKNF
Goals
• Arranging data into logical groups such that
each group describes a small part of the whole
• Minimizing the amount of duplicated data
stored in a database
• Building a database in which you can access
and manipulate the data quickly and
efficiently without compromising the integrity
of the data storage
• Organizing the data such that, when you modify
it, you make the changes in only one place
Benefits

• Use storage space efficiently


• Eliminate redundant data
• Reduce or eliminate inconsistent
data
• Ease the database maintenance
burden
1NF

• The relation is said to be in first


normal form, if and only if all the
fields in a record are single value.
• There should not be any repeating
groups of items
2NF

• A relation is said to be in second


normal form if and only if it is in
first normal form and every non key
field completely depends on either
the candidate keys (primary
key/alternate key) or the
concatenated key.
3NF

• A relation is said to be in third


normal form, if no non key field
depends on another non-key field.
• This form further divides 2NF table
into two more tables. So there are
total 4 tables
4NF

• A relation is said to be in fourth


normal form, if no key of a record
type contains two or more data
items which are independent and
multi-valued
• 4NF divides a 3NF table into 2 more
tables. So there are 5 tables in all
SUPPLIER-ORDER TABLE
(Un-normal form)

SUP. SUP. CITY CITY ITEM ITEM QTY PRICE


NO NAME CODE NAME NO NAME ORD

S01 NCL 01 ND 101 KBD 100 110

S01 NCL 01 ND 102 MOUSE 100 50

S01 NCL 01 ND 103 PLUG 200 25

S02 EB 02 JAIPUR 103 PLUG 100 25

S03 KBD 02 JAIPUR 104 CPU 50 5000


SUPPLIER TABLE (1 N F)

SUP. SUP. CITY CITY NAME


NO NAME CODE

S01 NCL 01 ND

S02 EB 01 ND

S03 KBD 02 JAIPUR


ITEM-ORDER TABLE (1 N F)

SUP. ITEM ITEM QTY PRICE


NO NO NAME ORD
S01 101 KBD 100 110

S01 102 MOUSE 100 50

S01 103 PLUG 200 25

S02 103 PLUG 100 25

S03 104 CPU 50 5000


SUPPLIER TABLE (2 N F)

SUP. SUP. CITY CITY NAME


NO NAME CODE

S01 NCL 01 ND

S02 EB 01 ND

S03 KBD 02 JAIPUR


ITEM TABLE (2 N F)

ITEM ITEM PRICE


NO NAME

101 KBD 110

102 MOUSE 50

103 PLUG 25

103 PLUG 25

104 CPU 5000


ORDER TABLE (2 N F)

SUP. ITEM QTY


NO NO ORD
S01 101 100

S01 102 100

S01 103 200

S02 103 100

S03 104 5000


SUPPLIER1 TABLE ( 3 N F )

SUP. SUP. CITY


NO NAME CODE

S01 NCL 01

S02 EB 01

S03 KBD 02
CITY TABLE (3 N F )

CITY CITY NAME


CODE

01 ND

02 JAIPUR
SUPPLIER2 TABLE (4 N F )

SUP. SUP.
NO NAME

S01 NCL

S02 EB

S03 KBD
CITY1 TABLE (4 N F)

SUP. CITY
NO CODE

S01 01

S02 01

S03 02

You might also like