Database Normalization - Summary &
Examples
First Normal Form (1NF)
1NF requires atomic values (no sets/lists in a cell), no multivalued or composite attributes,
and no nested relations.
Example:
- NOT 1NF: Ali | Math, Science
- 1NF: Ali | Math
Ali | Science
Second Normal Form (2NF)
2NF builds on 1NF and removes partial dependencies.
Non-key attributes must depend on the whole composite key, not part of it.
Example:
- NOT 2NF: StudentID + CourseID → StudentName
- 2NF: Break into two tables
Third Normal Form (3NF)
3NF requires no transitive dependencies.
Non-key attributes should not depend on other non-key attributes.
Example:
- NOT 3NF: EID → Title, Title → Salary
- 3NF: Break Title and Salary into separate tables
Boyce-Codd Normal Form (BCNF)
Stricter than 3NF. Every determinant must be a candidate key.
Example:
- NOT BCNF: Course → Instructor, Student → Instructor
- BCNF: Refactor into separate relations
Fourth Normal Form (4NF)
Removes multivalued dependencies.
Attributes must be independent of each other given the key.
Example:
- NOT 4NF: Smith → Project X & Department Y
- 4NF: Separate into Project and Department tables
Domain-Key Normal Form (DKNF)
The highest normal form. All constraints must be expressible as domain or key constraints.
Example:
- EmpID must be 4 digits, Email valid format
- All rules derived from domain or key constraints