Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Normal Forms Based on Primary Keys
Normalization organizes data in a database to reduce redundancy and improve consistency. Primary keys uniquely identify each row, and normal forms define progressive rules based on functional dependencies to eliminate data anomalies.
Types of Keys
| Key Type | Definition |
|---|---|
| Super Key | Set of attributes that uniquely identifies each record (may have extra attributes) |
| Candidate Key | Minimal super key no redundant attributes |
| Primary Key | Chosen candidate key for unique identification |
| Alternate Key | Candidate keys not selected as primary key |
| Foreign Key | Column referencing another table's primary key |
Normal Forms
First Normal Form (1NF)
Each column contains atomic values (no arrays or repeating groups), and each row is uniquely identified by a primary key.
Second Normal Form (2NF)
Must be in 1NF. Every non-key column is fully dependent on the entire primary key no partial dependencies. (Relevant when the primary key is composite.)
Third Normal Form (3NF)
Must be in 2NF. No non-key column depends on another non-key column eliminates transitive dependencies.
Boyce-Codd Normal Form (BCNF)
A stricter 3NF. Every non-trivial functional dependency must have a candidate key as its determinant. Applies when a table has multiple overlapping candidate keys.
Fourth Normal Form (4NF)
Must be in BCNF. Eliminates multi-valued dependencies no non-key column depends on a combination of other non-key columns independently.
Summary
| Normal Form | Eliminates |
|---|---|
| 1NF | Repeating groups, non-atomic values |
| 2NF | Partial dependencies on composite key |
| 3NF | Transitive dependencies |
| BCNF | Non-candidate-key determinants |
| 4NF | Multi-valued dependencies |
Conclusion
Normal forms provide progressive rules for eliminating redundancy based on primary key dependencies. Each level builds on the previous from ensuring atomic values (1NF) to removing multi-valued dependencies (4NF). Proper normalization reduces data anomalies and ensures consistent, maintainable database design.
