Introduction
BCNF: strictest normal form. Strengthens 3NF. Eliminates all anomalies from functional dependencies. Every determinant: candidate key. Strongest guarantee: minimal redundancy.
Cost: may not always achievable (rare). Trade: decomposition vs. dependency preservation. Practical: often use 3NF (sufficient, less decomposition).
"BCNF represents ideal normalization: every non-trivial FD stems from candidate keys. Achieves minimal anomalies, highest data integrity. Ideal when feasible." -- Normalization
BCNF Definition
Formal Definition
Relation in BCNF if: every non-trivial FD X -> Y, X is superkey (contains candidate key). Every determining attribute: part of key.
Simple Definition
Only keys determine other attributes. Non-key attributes: don't determine anything. Pure: keys only as determinants.
Implication
3NF allows: non-key determines non-key (if partial dependency doesn't violate). BCNF: forbids (stricter). BCNF subset of 3NF (stronger).
Candidate Keys
Multiple candidates possible. BCNF: every FD from at least one candidate. Check: all FDs against all candidates.
Checking BCNF
Algorithm
1. Identify candidate keys. 2. For each FD X -> Y: is X superkey? 3. If no to any: not BCNF.
Example Check
Table: StudentCourse (StudentID, CourseID, Professor)
Candidate key: {StudentID, CourseID}
FDs:
{StudentID, CourseID} -> Professor (key, OK)
Professor -> CourseID (professor teaches one course)
Check second FD:
Is Professor a superkey? No (no StudentID)
Not BCNF (violates definition)
All FDs Must Satisfy
Single violating FD: not BCNF. Must check all (including derived). Thorough: essential.
Examples
BCNF Example
Employee (EmployeeID, Name, Salary)
Candidate key: EmployeeID
FDs:
EmployeeID -> Name (EmployeeID is superkey, OK)
EmployeeID -> Salary (EmployeeID is superkey, OK)
BCNF: Yes (all FDs from superkey)
Non-BCNF Example
StudentCourse (StudentID, CourseID, Professor, Time)
Key: {StudentID, CourseID}
FDs:
{StudentID, CourseID} -> {Professor, Time} (key, OK)
Professor -> Time (professor teaches at fixed time)
Second FD violates BCNF (Professor not superkey)
Solution: decompose into:
StudentProfessor (StudentID, Professor)
ProfessorTime (Professor, Time)
BCNF vs. 3NF
Relationship
BCNF stricter than 3NF. Every BCNF is 3NF. Not every 3NF is BCNF.
Difference
3NF allows: non-key -> non-key if partial dependency preserved. BCNF: forbids (non-key cannot determine anything).
Practical Implication
3NF: good compromise (minimal anomalies, usually decomposable). BCNF: ideal but may require extra decomposition (dependency loss possible).
When BCNF Impossible
Rare: some schemas cannot achieve BCNF while preserving dependencies. Trade-off: choose 3NF (preserve dependencies) or BCNF (lose some dependencies, more decomposition).
Anomaly Prevention
Elimination
BCNF eliminates: update, insertion, deletion anomalies (from FDs). Non-key determining non-key: eliminated. Redundancy: minimized.
Data Integrity
Each attribute: independent determination. Change one: isolated. Consistency: ensured. Reliability: high.
Trade-off
More tables: join complexity. Benefits: anomaly prevention worth cost. Balance: evaluate per application.
Decomposition
Method
Find violating FD (X -> Y where X not superkey). Decompose: {X, Y} and {X, Z} (Z = remaining). Repeat: until BCNF.
Example
StudentCourse (StudentID, CourseID, Professor, Time)
Violating: Professor -> Time
Decompose:
Table1 (StudentID, CourseID, Professor) -- course assignment
Table2 (Professor, Time) -- professor schedule
Repeat: check if both in BCNF (usually yes after first decomposition)
Lossless
Decomposition lossless: can rejoin without loss. BCNF decomposition: always lossless (proven).
Dependency Preservation
Not always preserved (unlike 3NF). Trade: either anomalies or lost dependencies. Choose: based on requirements.
Trade-offs
Complexity
More tables: more joins (slower queries). Maintenance: more complex. Balance: analyze impact.
Dependency Preservation
BCNF may lose dependencies. Enforcement: application code needed. Cost: added logic.
When Worth It
Critical data: BCNF justified. Non-critical: 3NF sufficient. Evaluate: per table/domain.
Pragmatic Approach
Default: 3NF (good balance). Problematic tables: analyze (BCNF if feasible). Hybrid: mix of 3NF and BCNF.
Practical Considerations
Tool Support
Database design tools: suggest decompositions. Automated: check normalization. Manual verification: still recommended.
Denormalization
Performance: sometimes denormalize (known trade-off). Redundancy: accepted for speed. Maintain carefully: consistency risk.
Real-World Systems
Mixed: tables in 3NF or BCNF (performance tuned). Materialized views: pre-compute (offset join cost). Practical: balance theory and performance.
Testing
Verify: BCNF compliance (review FDs). Anomaly testing: insert/update/delete (verify no issues). Comprehensive: ensure correctness.
References
- Ramakrishnan, R., and Gehrke, J. "Database Management Systems." McGraw-Hill, 3rd edition, 2003.
- Garcia-Molina, H., Ullman, J. D., and Widom, J. "Database Systems: The Complete Book." Pearson, 2nd edition, 2008.
- Silberschatz, A., Korth, H. F., and Sudarshan, S. "Database System Concepts." McGraw-Hill, 6th edition, 2010.