Normal Forms &
Database Normalization
1NF · 2NF · 3NF · BCNF · 4NF · 5NF · Partial Dependency · Transitive Dependency · Functional Dependency · Lossless Decomposition · 45 MCQs with Explanations — GATE, IBPS, SSC, UPSC & Bank Exams
FoundationWhat is Database Normalization?
Normalization is the process of organising a relational database to reduce data redundancy and eliminate data anomalies. It involves decomposing large, poorly designed tables into smaller, well-structured tables using a set of rules called Normal Forms.
- Normalization is based on the concept of Functional Dependency (FD)
- Goal: reduce redundancy, improve data integrity, eliminate anomalies
- A relation is considered adequately normalised at 3NF (most real databases)
- Order: 1NF → 2NF → 3NF → BCNF → 4NF → 5NF (each is stricter than the previous)
- If a table is in BCNF, it is also in 3NF, 2NF, and 1NF
- Normalization improves data integrity but may reduce query performance (more joins needed)
Why We Need NormalizationDatabase Anomalies
| Anomaly Type | What Happens | Example |
|---|---|---|
| Insertion Anomaly | Cannot insert data without providing unnecessary other data | Cannot add a new department unless a student is already enrolled in it |
| Update Anomaly | Changing one piece of data requires multiple row updates → inconsistency risk | Changing a department name requires updating every student row in that department |
| Deletion Anomaly | Deleting one entity accidentally removes other unrelated information | Deleting the last student in a department also removes the department record |
- All three anomalies are caused primarily by data redundancy — storing the same information in multiple places
- Update anomaly is the most common trap question — answer is always redundant data
- Normalization eliminates redundancy → eliminates all three anomalies
Core Concepts — Must Know All 4Types of Dependencies
🔴 Partial Dependency
Removed by 2NFA non-key attribute depends on only PART of a composite primary key, not the whole key. Only occurs when the primary key is composite (2+ attributes).
StudentName → StudentID only
❌ Not (StudentID + Subject)
🟠 Transitive Dependency
Removed by 3NFA non-key attribute depends on another non-key attribute instead of depending directly on the primary key. Chain: Key → A → B (B is transitively dependent on Key via A).
StudentID → DeptID → DeptName
DeptName is transitively dependent
🟡 Multi-Valued Dependency
Removed by 4NFAttribute A multi-determines attribute B if for each value of A, there are multiple independent values of B. Notation: A →→ B.
Student →→ Hobby
(Two independent MVDs)
🟣 Join Dependency
Removed by 5NFA relation R has a join dependency if it can be reconstructed by joining multiple projections without information loss. Can’t always be detected from FDs alone.
(Lossless join of 3+ projections)
| Concept | Notation | Meaning | Example |
|---|---|---|---|
| Functional Dependency | X → Y | X functionally determines Y; knowing X uniquely identifies Y | StudentID → StudentName |
| Determinant | X (left side) | The attribute(s) that determine other attributes | StudentID is the determinant |
| Dependent | Y (right side) | The attribute(s) that are determined | StudentName is the dependent |
| Trivial FD | X → Y where Y ⊆ X | Y is a subset of X — always holds, not useful | {A,B} → A |
| Multi-valued Dep. | X →→ Y | X multi-determines Y — multiple Y values per X independently | Student →→ Hobby |
Essential TerminologyKeys in RDBMS
| Key Type | Definition | Example |
|---|---|---|
| Super Key | Any set of attributes that uniquely identifies a row (may have extra attributes) | {StudentID}, {StudentID, Name} |
| Candidate Key | Minimal super key — no attribute can be removed and still be unique | {StudentID} or {Email} if both are unique |
| Primary Key | One candidate key chosen as the main identifier for the table | StudentID is the primary key |
| Prime Attribute | An attribute that is part of ANY candidate key | StudentID (in a CK) is a prime attribute |
| Non-prime Attribute | An attribute NOT part of any candidate key | StudentName, DepartmentName |
| Foreign Key | An attribute that references the primary key of another table | DeptID in Students table → Departments table |
- In BCNF: every determinant must be a candidate key (not just any attribute)
- Super key ⊃ Candidate key ⊃ Primary key (superset to subset)
- A table with only ONE candidate key → BCNF = 3NF (they’re the same)
- Prime attribute = part of any candidate key | Non-prime = not part of any CK
Progressive Rules — Each Builds on PreviousNormal Forms Overview
Most Basic — Always Required1NF — First Normal Form
A table where one cell contains multiple values (like a comma-separated list) violates 1NF.
| StudentID | Name | Subjects |
|---|---|---|
| 1 | John | Math, Science |
| 2 | Alice | Physics, Chem |
Each cell has exactly ONE atomic value. Split multi-valued rows into separate rows.
| StudentID | Name | Subject |
|---|---|---|
| 1 | John | Math |
| 1 | John | Science |
| 2 | Alice | Physics |
| 2 | Alice | Chem |
- All values atomic — one value per cell, no lists or sets
- No repeating groups — no arrays or multi-value columns
- All rows unique — each row should be identifiable
- 1NF removes repeating group anomalies
- Example of 1NF violation: Phone column containing “9999, 8888” in one cell
Composite Key Problem2NF — Second Normal Form
Composite PK = (StudentID, Subject). StudentName depends only on StudentID, not the full key.
| StudentID | Subject | StudentName ❌ | Marks |
|---|---|---|---|
| 1 | Math | John | 90 |
| 1 | Science | John | 85 |
| 2 | Math | Alice | 88 |
| Students | |
|---|---|
| StudentID (PK) | StudentName |
| 1 | John |
| 2 | Alice |
| Marks | ||
|---|---|---|
| StudentID | Subject | Marks |
| 1 | Math | 90 |
| 1 | Science | 85 |
| 2 | Math | 88 |
Partial dependency eliminated. StudentName now depends fully on its own PK (StudentID). Marks depends on the full composite key (StudentID + Subject).
- 2NF only matters when the primary key is COMPOSITE (2+ attributes)
- If the primary key is a single attribute, a table in 1NF is automatically in 2NF
- Partial dependency: non-prime attribute depends on part of the composite PK
- Fix: split the table so each non-prime attribute depends on the entire key of its table
Most Practical Normal Form3NF — Third Normal Form
PK = StudentID. StudentID → DeptID → DeptName. DeptName is transitively dependent on StudentID via DeptID.
| StudentID (PK) | StudentName | DeptID | DeptName ❌ |
|---|---|---|---|
| 1 | John | D1 | Computer Sci |
| 2 | Alice | D2 | Physics |
| 3 | Bob | D1 | Computer Sci |
| Students | ||
|---|---|---|
| StudentID | StudentName | DeptID |
| 1 | John | D1 |
| 2 | Alice | D2 |
| 3 | Bob | D1 |
| Departments | |
|---|---|
| DeptID (PK) | DeptName |
| D1 | Computer Sci |
| D2 | Physics |
Transitive dependency eliminated. DeptName now directly depends on its own PK (DeptID). No redundancy — if dept name changes, update one row only.
- For every FD X → Y in the table: either X is a super key, OR Y is a prime attribute
- 3NF allows the second exception (Y is prime) — this is what BCNF tightens
- Most real-world databases are designed to 3NF as it balances integrity and performance
- Transitive chain: A → B → C means C is transitively dependent on A via B
Stricter than 3NFBCNF — Boyce-Codd Normal Form
CKs: (StudentID, Course) and (Course, Instructor). FD: Course → Instructor. Here Course is not a candidate key by itself, yet it determines Instructor.
| StudentID | Course | Instructor ❌ |
|---|---|---|
| 1 | DBMS | Prof. A |
| 2 | Networks | Prof. B |
| 3 | DBMS | Prof. A |
| Course_Instructor | |
|---|---|
| Course (PK) | Instructor |
| DBMS | Prof. A |
| Networks | Prof. B |
| Student_Course | |
|---|---|
| StudentID | Course |
| 1 | DBMS |
| 2 | Networks |
| 3 | DBMS |
Now every determinant is a candidate key. Course determines Instructor — and Course is the PK of Course_Instructor table.
- ▶3NF: X → Y is allowed if either X is a super key OR Y is a prime attribute
- ▶BCNF: X → Y is allowed ONLY if X is a super key — no prime attribute exception
- ▶BCNF may not always preserve all dependencies while 3NF always can
- ▶If table has only ONE candidate key, BCNF ≡ 3NF (they are the same)
- ▶BCNF is the highest normal form based on functional dependencies only
Beyond BCNF4NF and 5NF
| Normal Form | Dependency Addressed | Condition | Used In Practice? |
|---|---|---|---|
| 4NF | Multi-Valued Dependency (MVD) X →→ Y | For every non-trivial MVD X →→ Y, X must be a super key | Rarely — theoretical mostly |
| 5NF (PJNF) | Join Dependency | Every join dependency is implied by candidate keys; no lossless decomposition possible | Extremely rare — academic |
A student can have multiple hobbies AND multiple courses — two independent multi-valued facts stored in one table creates redundant rows.
| Student | Course | Hobby |
|---|---|---|
| Alice | DBMS | Painting |
| Alice | DBMS | Singing |
| Alice | Networks | Painting |
| Alice | Networks | Singing |
| Student | Course |
|---|---|
| Alice | DBMS |
| Alice | Networks |
| Student | Hobby |
|---|---|
| Alice | Painting |
| Alice | Singing |
Most Asked Table in ExamsMaster Comparison Table
| Normal Form | Built On | Eliminates | Condition | Exam One-liner |
|---|---|---|---|---|
| 1NF | — | Repeating groups, non-atomic values | All values atomic; no multi-valued cells | “No lists in cells” |
| 2NF | 1NF | Partial dependency | Every non-prime attr. fully depends on whole PK | “Whole key, nothing but the key” |
| 3NF | 2NF | Transitive dependency | X→Y: X is super key OR Y is prime attr. | “Non-key doesn’t depend on non-key” |
| BCNF | 3NF | All FD anomalies | Every determinant must be a candidate key | “Every determinant is a key” |
| 4NF | BCNF | Multi-valued dependency | For every MVD X→→Y, X is super key | “Remove independent multi-facts” |
| 5NF | 4NF | Join dependency | Every join dependency implied by CKs | “No lossless split possible” |
BCNF Trade-offLossless Join & Dependency Preservation
| Property | Meaning | Guaranteed By |
|---|---|---|
| Lossless Join | Decomposed tables can be JOINed back without gaining or losing any tuples | The common attribute between decomposed tables must be a super key in at least one of them |
| Dependency Preservation | All original functional dependencies can be derived from the decomposed tables without joining | 3NF decomposition always preserves; BCNF may not |
- 3NF decomposition → always achieves lossless join + dependency preservation
- BCNF decomposition → always achieves lossless join BUT may NOT preserve all dependencies
- This is the key trade-off: BCNF is stronger but may sacrifice dependency preservation
- Lossless condition: shared attribute must be a super key in at least one decomposed relation
- When BCNF and dependency preservation cannot both be achieved → settle for 3NF
Tap Any Option to Reveal AnswerMCQ Practice — 45 Questions (4 Chapters)
Last-Minute PrepQuick Revision Flash Cards
📋 Normal Forms Summary
- 1NF = Atomic values, no repeating groups
- 2NF = 1NF + No partial dependency
- 3NF = 2NF + No transitive dependency
- BCNF = Every determinant is a candidate key
- 4NF = BCNF + No multi-valued dependency
- 5NF = 4NF + No join dependency
🔴 Partial Dependency
- Non-prime attr depends on PART of composite PK
- Removed by: 2NF
- Only occurs with composite primary keys
- Single-attribute PK = no partial dependency possible
- Fix: Split into separate tables
🟠 Transitive Dependency
- A → B → C (C is transitively dependent on A)
- Removed by: 3NF
- Non-key attribute depends on another non-key attribute
- Example: StudentID → DeptID → DeptName
- Fix: Move B→C to a separate table
💎 BCNF Key Points
- Every determinant must be a candidate key
- Stricter than 3NF — removes 3NF’s prime-attr exception
- BCNF = highest NF for functional dependencies only
- Single CK table: BCNF = 3NF
- May NOT preserve all dependencies (trade-off)
🔄 Lossless & Dependency
- Lossless join: common attribute = super key in one table
- 3NF = always lossless + dependency preserving
- BCNF = always lossless, but may NOT preserve deps
- If both impossible → settle for 3NF
🔑 Key Types
- Super key = any unique identifier (may have extras)
- Candidate key = minimal super key
- Primary key = chosen candidate key
- Prime attribute = part of any candidate key
- Non-prime = not part of any candidate key
⚠️ Three Anomalies
- Insertion anomaly = can’t insert without unrelated data
- Update anomaly = change one = change many
- Deletion anomaly = delete one = lose unrelated data
- Root cause: data redundancy
- Solution: normalization
🎯 Exam Mnemonics
- 1NF: “No lists in cells”
- 2NF: “Whole key, nothing but key”
- 3NF: “Non-key doesn’t depend on non-key”
- BCNF: “Every determinant is a key”
- 4NF: “No independent multi-facts”
- 5NF: “No lossless split possible”
Related notes
More free study notes in Information Technology — all part of the GyanDesk study library.
