Boyce-Codd Normal Form: BCNF

A table/relation is in BCNF if, for every non-trivial functional dependency X → Y, X must be a super key in the table. BCNF is the stronger version of 3NF.

Definition

Only two shapes of FD are allowed:
super key → prime attribute
super key → non-prime attribute
Here X = determinant, Y = dependent attribute, and a super key is an attribute or set of attributes that can uniquely identify each row.

In simple words: for every functional dependency, the left side must be able to uniquely identify a row.
Compare with 3NF, which also allowed non-super key → prime attribute. That single extra allowance is the whole difference between 3NF and BCNF.

Example — Teacher / Course / Room

Teacher_IDCourse_IDRoom
T01CSE101R1
T02CSE102R2
T03CSE101R1
T04CSE103R3
Assume the following rules: one teacher teaches one course; each course is always held in one fixed room.

a. Find all possible functional dependencies:

Teacher_ID → Course_ID
Course_ID → Room

b. Find the super key:

Teacher_ID → Course_ID → Room
Therefore Teacher_ID is the candidate key (super key).
Teacher_ID → Course_ID
This FD is in BCNF, as Teacher_ID is a super key.
Course_ID → Room
This FD is not in BCNF, as Course_ID is not a super key.
Therefore, the table is not in BCNF.

Issues if a table is not in BCNF

AnomalyWhat goes wrong
UpdateIf the room of CSE101 changes from R1 to R5, it must be updated in multiple rows (T01 and T03). If one row is updated and another is not, data inconsistency occurs.
InsertionA new course with a fixed room cannot be inserted unless a teacher is assigned — CSE104 is held in R4, but if no teacher has been assigned yet this cannot be stored properly.
DeletionIf teacher T04 leaves and that was the only row for CSE103, then deleting T04 also removes the information that CSE103 is held in R3.

Solution — break the table based on functional dependency

Teaching table

Teacher_IDCourse_ID
T01CSE101
T02CSE102
T03CSE101
T04CSE103

Course table

Course_IDRoom
CSE101R1
CSE102R2
CSE103R3
Both tables are in BCNF, as in both tables Teacher_ID and Course_ID are the candidate key (super key) of their own relation.

A table might be in 3NF but not in BCNF

Student_IDCourse_IDInstructor
S01CSE101Dr. Hasan
S02CSE101Dr. Hasan
S03CSE102Dr. Karim
S04CSE102Dr. Karim
S01CSE102Dr. Karim
Rules: a student can take many courses; a course can be taught by only one instructor. Candidate keys: (Student_ID, Course_ID) and (Student_ID, Instructor).
(Student_ID, Course_ID) → Instructor
satisfies super key → non-prime attribute, so this FD is in 3NF and BCNF.
Instructor → Course_ID
satisfies non-super key → prime attribute, so this FD is in 3NF
but this condition is NOT allowed in BCNF: X must be a super key in X → Y.
The table is in 3NF · The table is NOT in BCNF.

Fixing it

Enrollment table

Student_IDCourse_ID
S01CSE101
S02CSE101
S03CSE102
S04CSE102
S01CSE102

Teaching table

Course_IDInstructor
CSE101Dr. Hasan
CSE102Dr. Karim
Both tables are in BCNF.
The price of BCNF. The dependency (Student_ID, Course_ID) → Instructor now spans two tables — you can no longer check it without a join. BCNF decomposition is always lossless but not always dependency-preserving; 3NF decomposition can always be both. That is why textbooks say “normalize to 3NF, go to BCNF only if the anomaly actually hurts”.

The four forms side by side

FormConditionRemoves
1NFAtomic values, no repeating groups, unique rowsMulti-valued cells
2NF1NF + no partial dependencyNon-key depending on part of a composite key
3NF2NF + no transitive dependency
(or: X is a super key OR Y is prime)
Non-key depending on another non-key
BCNFEvery determinant X is a super keyNon-super-key → prime attribute

Next: Validation, merits & demerits →