Boyce–Codd normal form

Also known as: BCNF · 3.5NF

On this page 7

Boyce–Codd normal form (BCNF) is a level of relational database normalization in which, for every nontrivial functional dependency X → Y, the determinant X is a superkey of the table. In data modeling for relational databases, it is a slightly stronger version of third normal form, which is why it is sometimes called 3.5NF. It was defined in 1974 by Raymond F. Boyce and Edgar F. Codd to remove update anomalies that third normal form can still allow.

Put briefly, a table is in BCNF when every fact depends on the key, the whole key and nothing but a key, with no exception for attributes that happen to belong to a candidate key.

How the BCNF condition is defined

BCNF is stated entirely in terms of functional dependencies. A functional dependency X → Y holds when any two rows that agree on the attributes in X must also agree on Y. A dependency is trivial when Y is a subset of X, and trivial dependencies are ignored by the rule.

The test is therefore simple to state: list every nontrivial dependency, compute the attribute closure of each left-hand side, and verify that the closure contains all attributes of the relation. If any determinant fails this test, the relation violates BCNF and should be considered for decomposition.

The table places BCNF among the neighboring normal forms so that the added strictness is visible.

Normal formCore requirementAnomaly it removes
First normal formAtomic values, no repeating groupsMulti-valued cells
Second normal formNo partial dependency on a composite keyFacts tied to part of the key
Third normal formNo transitive dependency of non-key attributesFacts about non-key attributes
Boyce–Codd normal formEvery determinant is a superkeyDependencies among key attributes
Fourth normal formNo nontrivial multivalued dependencyIndependent repeating facts
BCNF among the classic normal forms

Why third normal form is not always enough

Third normal form permits a dependency X → A when A is a prime attribute, meaning A belongs to some candidate key. BCNF removes that exception. The difference matters only when a table has multiple overlapping candidate keys, which is why most tables in third normal form are already in BCNF.

A classic case is a teaching schedule with attributes Student, Course and Instructor. Suppose each instructor teaches exactly one course, and each student takes a given course with one instructor. The dependencies are {Student, Course} → Instructor and Instructor → Course. Candidate keys are {Student, Course} and {Student, Instructor}, so Course is prime and the table satisfies third normal form.

Yet Instructor alone is not a superkey, so the table violates BCNF. The consequences are concrete anomalies, summarized below.

AnomalyWhat happensRoot cause
Update anomalyChanging an instructor’s course requires editing many rowsCourse repeated for each student
Insertion anomalyA new instructor cannot be recorded without a studentInstructor fact stored with enrollment
Deletion anomalyRemoving the last student erases the instructor’s courseTwo facts share one row
Anomalies in the non-BCNF schedule table

Decomposing a relation into BCNF

The standard algorithm repeatedly takes a violating dependency X → Y and splits the relation R into R1 = X ∪ Y and R2 = R minus (Y minus X). Each step is a lossless-join decomposition, because the shared attributes X form a key of R1, so the natural join of the pieces reconstructs the original rows exactly.

  1. Identify all functional dependencies, including those implied by Armstrong’s axioms.
  2. Find a nontrivial dependency whose determinant is not a superkey.
  3. Split the relation on that dependency into two projections.
  4. Project the dependencies onto each new relation and repeat until no violation remains.

Applied to the schedule example, the split on Instructor → Course yields Teaching(Instructor, Course) and Enrollment(Student, Instructor). Both are in BCNF, and each fact is now stored once.

The dependency preservation trade-off

The central limitation of BCNF is that a lossless decomposition cannot always preserve every functional dependency. In the schedule example, the rule {Student, Course} → Instructor no longer lives inside a single table, so a database cannot enforce it with an ordinary primary key or unique constraint.

Third normal form, by contrast, is always achievable with a decomposition that is both lossless and dependency-preserving, through the synthesis algorithm. Designers therefore choose deliberately, as the comparison shows.

CriterionThird normal formBCNF
Lossless joinAlways achievableAlways achievable
Dependency preservationAlways achievableNot guaranteed
Redundancy from key dependenciesPossibleEliminated
Constraint enforcementKeys and unique constraints sufficeMay need triggers or assertions
Typical choiceWhen rules must be enforced simplyWhen redundancy is the bigger risk
Third normal form versus BCNF in design decisions

When a lost dependency matters, teams either accept third normal form for that table or enforce the cross-table rule with triggers, check logic in the application or materialized views with unique indexes.

BCNF in practical data modeling

In operational OLTP schemas, BCNF is a sensible default target for transactional tables, because it minimizes redundancy and keeps updates safe. Most entities modeled from a clear ER diagram with a single natural key or surrogate key reach BCNF without extra effort.

The form is deliberately relaxed in analytical systems. A star schema stores denormalized dimension tables to speed up reads, and denormalization is a conscious choice there, not an error. Common modeling mistakes include:

  • Testing only the primary key and ignoring alternate candidate keys, where BCNF violations hide.
  • Relying on a surrogate key as proof of normalization, although the dependencies among natural attributes remain.
  • Inferring dependencies from sample data instead of from business rules, which produces false conclusions.
  • Decomposing blindly and losing a business rule that no longer fits inside one table.

Understanding it simply

Boyce–Codd normal form is a tidiness rule for database tables. It says that whenever one piece of information decides another, the deciding piece must be able to identify a whole row on its own.

If a table breaks the rule, the same fact gets copied into many rows, and sooner or later one copy is changed while the others are forgotten. Splitting the table so each fact lives in one place fixes this, although occasionally a business rule then spans two tables and needs extra checking.

Applied in practice

A university registrar’s database stores course sections in a table of Student, Course and Teaching assistant, where each assistant is assigned to exactly one course. When an assistant moved from Statistics 101 to Statistics 201, staff updated only 180 of the 212 affected rows, and 32 students appeared under the wrong course in grade reports.

A data modeler identified the dependency Assistant → Course as a BCNF violation and split the table into Assistant(Assistant, Course) and Enrollment(Student, Assistant). Future reassignments became a single-row update, and the rule that a student has one assistant per course was enforced with a short trigger, since that dependency no longer fit inside one table.