Database Normalization

In databases, 1N, 2N, 3N refer to 1NF, 2NF, 3NF β€” the first three normal forms in database normalization. These are rules to organize relational data efficiently and eliminate redundancy.

βœ… 1NF (First Normal Form)

πŸ“Œ Rule:

  • Each column should have atomic (indivisible) values.
  • No repeating groups or arrays in a single column.

❌ Bad Example:

ID Name Phone Numbers
1 Aftab 12345, 67890

βœ… Good Example (1NF applied):

ID Name Phone
1 Aftab 12345
1 Aftab 67890

βœ… 2NF (Second Normal Form)

πŸ“Œ Rule:

  1. Be in 1NF
  2. Remove partial dependencies (i.e., non-key columns should depend on the whole primary key)

❌ Bad Example (composite key: OrderID, ProductID):

OrderID ProductID ProductName CustomerName
1 101 Mouse Aftab

Β 

➑️ CustomerName depends only on OrderID, not the full composite key.

βœ… Fix:

Split into:

  1. Order table (OrderID, CustomerName)
  2. OrderDetails table (OrderID, ProductID, ProductName)

βœ… 3NF (Third Normal Form)

πŸ“Œ Rule:

  • Be in 2NF
  • No transitive dependencies (i.e., non-key columns shouldn’t depend on other non-key columns)

❌ Bad Example:

StudentID Name Department HOD
1 Raj IT Dr. Mehta

Β 

➑️ HOD depends on Department, not directly on StudentID.

βœ… Fix:

Split into:

  • Student table (StudentID, Name, Department)
  • Department table (Department, HOD)

🧠 Summary Table:

Normal Form Goal Fixes
1NF Atomic values No arrays or multi-values
2NF Full key dependency Remove partial dependencies
3NF No transitive dependencies Normalize non-key columns
Back to blog

Leave a comment