Previous | Home | Next |
It is a technique in which we are decomposing the existing data into different tables which reduces the redundency and undesirable characteristics like insertion, updation , deletion operation performed in database.
Normalization of database means we are normalizing the given database.It mainly used for two purpose only, they are:
- Eliminating the redundent(useless) data from the database.
- Data is stored in different table in should be relevant and make dependencies i.e. all data is logically stored
Normalization have the following rules that divides it into the form known as Normal Form, they are:
- First Normal Form
- Second Normal Form
- Third Normal Form
- BCNF
First Normal Form(1NF)
In this nomal form, no two row or columns have the same data element i.e. each set of column must have the unique value. in this normal form data redundency get increases as there are many columns have the same data into their columns but each row should be unique.
example
In this we are having the details of student in the database table of a school, we are appllying the 1NF as defined in the below table view
Student | age | Address |
Arun | 24 | Saket |
Kuldeep | 23 | Malviya Nagar |
Hemant | 24 | Gurgaon |
Prasant | 24 | Kotla |
Gaurav | 25 | Laxmi Nagar |
Second Normal Form(2NF)
In this normal form, the data which is already stored in 1NF, its all attributes within the table should be solely dependent in the unique identity of that entity.
example
In this we are applying the 2NF in the above define table , we are decomposing the table into twop tables like Student table and Address table as below
Student table
Student | age |
Arun | 24 |
Kuldeep | 23 |
Hemant | 24 |
Prasant | 24 |
Gaurav | 25 |
Address table
Student | Address |
Arun | Saket |
Kuldeep | Malviya Nagar |
Hemant | Gurgaon |
Prasant | Kotla |
Gaurav | Laxmi Nagar |
Third Normal Form
In this normal form, we are providing the non-prime attribute of each table must be dependent on the Primary key. In this we are creating the transitive dependencies which help in data integrity.
example
In the above table define in 2NF we are giving the primary key to each table and assign dependency on it.
Student table
Student_id | Student | age |
101 | Arun | 24 |
102 | Kuldeep | 23 |
103 | Hemant | 24 |
104 | Prasant | 24 |
105 | Gaurav | 25 |
Address table
Address_id | Student | Address |
201 | Arun | Saket |
202 | Kuldeep | Malviya Nagar |
203 | Hemant | Gurgaon |
204 | Prasant | Kotla |
205 | Gaurav | Laxmi Nagar |
Boyce-Codd normal form (BCNF)
This is the highest version of 3NF, it is based on the concept of Determinant, in which some attribute is fully functionaly dependent. The relation in a bcnf if and only if every determinant is a candidate key.
Previous | Home | Next |