Normalization

It is the process off organizing data to minimize data redundancy, which in turn ensures data consistency.

Normalization rules divides larger tables into smaller tables and links them using relationships. The purpose of Normalization in SQL is to eliminate redundant (repetitive) data and ensure data is stored logically. 

Problem of data redundancy:

1. Disk space wastage
2. Data Inconsistency
3. DML query can become slow

 
First NF:
  • The data in each column should be atomic.
  • The table doesn't contain any repeating column
  • Identify each record uniquely using primary key

Convert below Table into First Normal Form:

Database Normalization With Example 

 Convert into First Normal form:

Example of 1NF in DBMS

Second Normal Form:
  • The table meet all the condition of 1 NF
  • Move redundant table to a separate table
  • Create relationship between these table using foreign key
Convert above Table into 2nd NF:

2NF Example

2NF Example in DBMS


Third Normal Form
  • Meet all the condition of 1NF and 2 NF
  • doesn't contain columns that are not fully dependent upon the primary key or transitive functional dependencies
Transitive functional dependencies in Database


3NF Example

3NF Example

Example of 3NF in Database