Saturday, 23 April 2016

What is Normalization and five steps of Normalization?

What is meant by Normalization and its steps?

Normalization
Definition:
The process of decomposing relations with anomalies to produce smaller and well structured relations.
Steps in Normalization:
The three main steps of normalization are listed below.
"NF" refers to "normal form."
·         1NF
·         2NF
·         3NF
The following three NFs exist but are rarely used:
·         BCNF
·         4NF
·         5NF
First Normal form (1NF):
A database is in first normal form if it satisfies the following conditions:
  • Contains only atomic values
  • There are no repeating groups (multi valued attributes).
  • A relation is in first normal form if every attribute in every row can contain only one single (atomic) value.
  • A primary key is defined.
Example:
Student (first name, Name, knowledge)

The attribute Skills can contain multiple values and therefore the relation is not in the first normal form. But the attributes Name and Surname are atomic attributes that can contain only one value. 


2nd Normal form (2NF):
·         A relation is in second normal form if it is in 1NF
·          Every non key attribute is fully functionally dependent on the primary key.
Example: Student (IDSt, StudentName, IDProf, ProfessorName, Grade)
The following functional dependencies exist:
1. The attribute ProfessorName is functionally dependent on attribute IDProf (IDProf --> ProfessorName)
2. The attribute StudentName is functionally dependent on IDSt (IDSt --> StudentName)
3. The attribute Grade is fully functional dependent on IDSt and IDProf (IDSt, IDProf --> Grade)


3rd Normal form (3NF):
·         A relation is in third normal form if it is in 2NF  


·         No non key attribute is transitively dependent on the primary key.
Example:  Vendor (ID, Name, Account_No, Bank_Code_No, Bank)
The attribute ID is the identification key. All attributes are single valued (1NF). The table is also in 2NF. The following dependencies exist:
1. Name, Account_No, Bank_Code_No are functionally dependent on ID (ID --> Name,     Account_No, Bank_Code_No)
2. Bank is functionally dependent on Bank_Code_No (Bank_Code_No --> Bank).



4th Normal form (4NF):
·         Fourth normal form (4NF) is a level of database normalization where there are no non-trivial multivalued dependencies other than a candidate key.
·         It contain primary key.
·         It builds on the first three normal forms (1NF, 2NF and 3NF) 
 It must not contain more than one multivalued dependency.


5th Normal form (5NF):
·         A database table is said to be in 5NF if it is in 4NF and contains no redundant values
·         We can also said a table to be in 5NF if it is in 4NF and contains no join dependencies.
·         The process of converting the table into 5NF is as follows:
1.    Remove the join dependency.
<![endif]-->





No comments:

Post a Comment