DBMS Topics
Boyce-Codd Normal Form BCNF
Last Updated : 21 May, 2026
A relation R is in BCNF Boyce-Codd Normal Form if, for every non-trivial functional dependency X → Y in R:
Definition
A relation R is in BCNF (Boyce-Codd Normal Form) if, for every non-trivial functional dependency X → Y in R:
- X is a superkey of R
This is a stricter version of 3NF — the "prime attribute" exception of 3NF is removed.
When 3NF ≠ BCNF
A relation can be in 3NF but NOT BCNF when there is a FD X → Y where:
- X is NOT a superkey, AND
- Y is a prime attribute (part of some candidate key)
Classic Example
| Relation | CourseTeacher(Student, Course, Teacher) |
| (Student, Course) | Teacher |
| Teacher | Course |
| Candidate Keys | (Student, Course), (Student, Teacher) |
| Prime Attributes | Student, Course, Teacher (ALL are prime) |
| Teacher | Course: Course is prime → OK for 3NF ✓ |
| Teacher | Course: Teacher is NOT a superkey → VIOLATES BCNF ✗ |
BCNF Decomposition Algorithm
WHILE R is not in BCNF
Find a non-trivial FD X → Y in R where X is NOT a superkey
Decompose R into
R1 = X ∪ Y (takes the violating FD out)
R2 = R − Y + X (remaining attributes + X as FK)
UNTIL all relations are in BCNF
Applying to the Example
| Violating FD: Teacher | Course (Teacher not a superkey) |
| TeacherCourse(Teacher, Course) ← PK | Teacher |
| StudentTeacher(Student, Teacher) ← PK | (Student, Teacher) |
| TeacherCourse: Teacher | Course; Teacher is PK (superkey) ✓ BCNF |
| StudentTeacher | No non-trivial FDs other than full key ✓ BCNF |
BCNF Decomposition — More Examples
Example 2
| FDs: A | B, B → C, C → D, D → A |
| Candidate Keys | A, B, C, D (each determines all others) |
| Check: A | B: A is a candidate key (superkey) ✓ |
| B | C: B is a candidate key ✓ |
| C | D: C is a candidate key ✓ |
| D | A: D is a candidate key ✓ |
Example 3
| FDs: AB | C, C → B |
| Candidate Keys | AB, AC (both determine all attributes) |
| Check: AB | C: AB is a superkey ✓ |
| C | B: C is NOT a superkey (C⁺ = {C,B} ≠ {A,B,C}) ✗ |
| Violating FD: C | B |
| R1 = (C, B) ← PK: C (C | B is preserved) |
| No non-trivial FD within {A,C} (since C | B removed B, not A) |
| PK | (A,C) ✓ BCNF |
| Final | R1(C, B), R2(A, C) — both in BCNF ✓ |
BCNF Drawback — Dependency Preservation
BCNF decomposition may not always preserve all functional dependencies. When this happens, enforcing certain constraints requires joining tables back together — which is expensive.
| Original R | CourseTeacher(Student, Course, Teacher) |
| FD Teacher | Course is LOST in decomposition to BCNF. |
| The constraint Teacher | Course is enforced by TeacherCourse. |
| But (Student, Course) | Teacher now requires a JOIN to verify. |
This is why 3NF is sometimes preferred over BCNF — 3NF always allows a lossless, dependency-preserving decomposition.
Summary
| BCNF Rule: For EVERY non-trivial FD X | Y: |
| Advantages | Eliminates all redundancy based on FDs |
| Disadvantage | May not preserve all FDs |
| When to use | When data integrity is more important than |
Exam Focus
Revise definitions, diagrams, examples, and short-answer points for Boyce-Codd Normal Form BCNF.
Interview Use
Prepare one clear explanation, one practical example, and one common mistake for this DBMS topic.
Search Terms
dbms, database management system, database notes, sql, unit, bcnf, boyce-codd normal form bcnf
Related DBMS Topics