SyntaxStudy
Sign Up
MySQL Boyce-Codd Normal Form (BCNF)
MySQL Advanced 5 min read

Boyce-Codd Normal Form (BCNF)

BCNF

BCNF is a stricter version of 3NF: for every functional dependency X → Y, X must be a superkey. It handles edge cases 3NF misses with composite candidate keys.

Example
-- Example: students can take many courses, taught by one teacher per course
-- (student, course) -> teacher   [teacher depends on course]
-- teacher -> course              [teacher determines course]
-- PK is (student, course) but teacher -> course violates BCNF

-- Fix: separate course_teachers table
-- course_id -> teacher_id
Pro Tip

BCNF violations are rare but important in schemas with multiple overlapping candidate keys.