9.0 KB · commit 40bb182
| title | T08.9 · Boyce-Codd Normal Form (BCNF) and 3NF vs. BCNF |
|---|
← Previous: T08.8b · Table Normalization Walkthroughs II (2020 & 2023) | 🏠 Index | Next: T08.10 · Pros and Cons of Normalization & Denormalization →
Topic: T08 · Normalization & Functional Dependencies | Priority: 🟢 Core | Exam Frequency: 0/7 finals · CT-03 Q01(d) & Q04 (6 marks) Sources: Silberschatz 7e Ch. 7 (§7.3.1, §7.3.3, §7.5.1) · Lecture Deck 06 (Slides 41–46) · Raidah Class Notes (pp. 22–23)
Boyce-Codd Normal Form eliminates all data redundancy caused by functional dependencies.
Boyce-Codd Normal Form (BCNF): A relation schema R is in BCNF with respect to functional dependency set F if, for every non-trivial functional dependency α→β in F+:
α is a superkey of RThird Normal Form (3NF): A relation schema R is in 3NF if, for every non-trivial functional dependency α→β in F+, at least one of the following holds:
Determinant: The left-hand attribute set α in dependency α→β. Under BCNF, every determinant must be a superkey.
Suppose schema R(Student,Course,Instructor) has overlapping candidate keys {Student,Course} and {Student,Instructor}. All three attributes are prime.
If each instructor teaches only one course (Instructor→Course):
BCNF removes the prime-attribute escape clause entirely: Instructor must be a superkey. Because it is not, the relation violates BCNF.
| Feature | Third Normal Form (3NF) | Boyce-Codd Normal Form (BCNF) |
|---|---|---|
| Strictness | Less strict (allows prime-attribute loophole) | Strictly stronger (zero FD redundancy) |
| Condition on α→β | α is superkey OR β−α is prime | α MUST be a superkey |
| Overlapping Key Anomalies | Permitted | Eliminated |
| Lossless-Join Decomposition | Always achievable | Always achievable |
| Dependency Preservation | Always guaranteed | Not always guaranteed |
If relation R is in BCNF, every non-trivial dependency α→β satisfies condition 1 (α is a superkey). Since condition 1 of 3NF is identical to the only condition of BCNF, every BCNF relation is automatically in 3NF:
BCNF⊂3NF⊂2NF⊂1NFHowever, a 3NF relation is not necessarily in BCNF when a non-trivial dependency relies on the prime-attribute escape clause (where α is not a superkey but β is prime).
CO3 · Asked in: CT-03
Question. Consider ENROLLMENT(StudentID,StudentName,CourseID,CourseName,InstructorID,InstructorName,Grade) with functional dependencies: StudentID→StudentName; CourseID→CourseName,InstructorID; InstructorID→InstructorName; (StudentID,CourseID)→Grade.
(d) Determine the highest normal form satisfied by the given relation. Give a proper justification.
Answer.
First Normal Form (1NF) Check:
All attributes hold atomic, single values. Therefore, the relation satisfies 1NF.
Second Normal Form (2NF) Check:
The candidate key is composite: {StudentID,CourseID}.
Prime attributes: {StudentID,CourseID}.
Non-prime attributes: {StudentName,CourseName,InstructorID,InstructorName,Grade}.
Examining the functional dependencies:
Both dependencies are partial functional dependencies. Because non-prime attributes depend on proper subsets of the candidate key, the relation violates 2NF.
CO3 · Asked in: CT-03
Question. Justify the statement: "Every BCNF relation is in 3NF, but every 3NF relation is not necessarily in BCNF."
Answer.
If a relation is in BCNF, every non-trivial FD α→β satisfies condition 1 (α is a superkey). Since condition 1 of 3NF is identical to the only condition of BCNF, every dependency that satisfies BCNF automatically satisfies 3NF. Thus, BCNF is a stricter subset of 3NF:
BCNF⊂3NFConsider relation R(A,B,C,D) with functional dependencies:
F={AB→CD,D→A}Find Candidate Keys:
Check 3NF:
Check BCNF:
Because relation R is in 3NF but not in BCNF, the statement is justified.
← Previous: T08.8b · Table Normalization Walkthroughs II (2020 & 2023) | 🏠 Index | Next: T08.10 · Pros and Cons of Normalization & Denormalization →