Normalization is process of database design to make the data more organized, reduce redundancy, reduce inconsistency and ensure data integrity. Types of normalizations are levels of optimization on the database. 1. 1NF - First Normal Form 2. 2NF - Second Normal Form 3. 3NF - Third Normal Form 4. Boyce-Codd Normal Form 5. 4NF Fourth Normal Form 6. 5NF - Fifth Normal Form 7. 6NF - Sixth Normal Form

Quick Summary

  • 1NF: Atomic columns, no repeating groups.
  • 2NF: No partial dependencies.
  • 3NF: No transitive dependencies.
  • BCNF: Every determinant is a super key.
  • 4NF: No multi-valued dependencies.
  • 5NF: No join dependencies.
  • 6NF: No non-trivial join dependencies, with a focus on temporal data.

1. 1NF - First Normal Form

  • All Columns contain atomic, indivisible values
  • All values in a column must be of same type
  • Each entry in a column must be unique

Not in 1NF:

IDNamePhone Numbers
1John Smith123-456, 789-101
2Jane Doe234-567

In 1NF:

IDNamePhone Number
1John Smith123-456
1John Smith789-101
2Jane Doe234-567

2. 2NF - Second Normal Form

  • 1NF applied
  • All non-key attributes/values must be functionally dependent on the primary key, and there must not be any partial dependency

Not in 2NF:

  • Consider a table where a composite primary key is formed by OrderID and ProductID. Here, ProductName depends only on ProductID, not on the entire composite key.
  • The CustomerName is not functionally dependent on the Primary Key, hence it should be removed.
OrderIDProductIDProductNameQuantityCustomerName
1101Laptop2John
1102Phone1Elton
2101Laptop1Joseph

3. 3NF - Third Normal Form

  • 1NF, 2NF Applied
  • There must be not transitive dependency of any column

Not in 3NF:

EmployeeIDEmployeeNameDepartmentIDDepartmentName
1John Smith10HR
2Jane Doe20IT
Explanation: DepartmentName is dependent on the DepartmentID which depends on primary key, hence forming a transitive dependency.

In 3NF:

EmployeeIDEmployeeNameDepartmentID
1John Smith10
2Jane Doe20
DepartmentIDDepartmentName
10HR
20IT

4. Boyce-Codd Normal Form

  • For every functional dependency, A B, the attribute set A must be the super key in the table. Here A B, means A is the determining value for B.
  • For example: In Course → Instructor relation, Course is not a super key in the table. Yet, it determines Instructor, which violates the BCNF condition.
StudentIDCourseInstructor
1MathJohn
2ScienceJane
1ScienceJane
3MathJohn
Decomposed Tables: Courses Table Represents the direct relationship where Course determines Instructor. Here Course column is the super key.
CourseInstructor
MathJohn
ScienceJane

5. 4NF Fourth Normal Form

  • It has no mult-values dependencies, no attribute sets that are independent but stored together

Not in 4NF:

StudentIDCourseActivity
1MathChess
1ScienceChess
1MathBasketball
2MathChess

In 4NF:

StudentIDCourse
1Math
1Science
2Math
StudentIDActivity
1Chess
1Basketball
2Chess

6. 5NF - Fifth Normal Form

  • It cannot have any lossless decomposition into smaller tables that can be joined back together without loss of information.

7. 6NF - Sixth Normal Form

  • It deals with temporal data and ensures no non-trivial join dependencies, applicable in time-series databases or databases where time is an important factor.