Skip to content
  • Normalization · DBMS

Normalization

LearnViaNotes @learnvianotes· 3 min read

Normalization is the mathematical process of decomposing tables to reduce data redundancy, eliminate data anomalies, and preserve functional dependencies.

Database Anomalies Illustrated

Suppose we store student and course info in one unnormalized table:

Table: StudentCourse
StudentID | Name    | CourseID | CourseName | DeptHead
----------+---------+----------+------------+---------
101       | Alice   | CS10     | DBMS       | Dr. Smith
101       | Alice   | CS20     | Networks   | Dr. Smith
102       | Bob     | CS10     | DBMS       | Dr. Smith

Finding Candidate Keys Algorithm

Armstrong's Axioms in Detail

Axiom RuleMathematical DefinitionExplanation / Example
ReflexivityIf Y ⊆ X, then X → YIf X contains Y, then X determines Y. e.g. {ID, Name} → {Name}
AugmentationIf X → Y, then XZ → YZAdding attributes to both sides preserves dependency. e.g. If ID → Name, then {ID, Code} → {Name, Code}
TransitivityIf X → Y and Y → Z, then X → ZChain rule. e.g. If StudentID → ZipCode and ZipCode → City, then StudentID → City
Union (Secondary)If X → Y and X → Z, then X → YZIf X determines two fields separately, it determines both.
Decomposition (Secondary)If X → YZ, then X → Y and X → ZWe can split the RHS attributes into separate dependencies.

Normal Forms (1NF - 5NF)

1NF, 2NF, 3NF

Normal FormCore RequirementDependency Avoidance
1NF (First Normal Form)All column values must be atomic (no multi-valued attributes, no repeating groups).Removes duplicate records and structural repeating nesting.
2NF (Second Normal Form)Must satisfy 1NF, and have no Partial Dependency.No non-prime attribute should depend on a proper subset of a candidate key.
3NF (Third Normal Form)Must satisfy 2NF, and have no Transitive Dependency.For every non-trivial FD X → Y, either X is a superkey or Y is a prime attribute.

BCNF, 4NF, 5NF

Normal FormCore RequirementDetails / Focus
BCNF (Boyce-Codd Normal Form)Stricter version of 3NF. For every non-trivial FD X → Y, X must be a superkey.Eliminates cases where a prime attribute is determined by a non-prime attribute.
4NF (Fourth Normal Form)Must satisfy BCNF and contain no Multi-Valued Dependencies (MVD).Prevents independent 1-to-many relationships from creating duplicate records in one table.
5NF (Fifth Normal Form)Must satisfy 4NF and have no Join Dependency.Ensures a table cannot be decomposed and reconstructed without losing data.

Decomposition Properties

Denormalization

Free for students and teachers

Write notes like this one

Cards for every idea, quizzes and flashcards, read aloud — on the web and your phone.

Something wrong with this note? Open it to report