codingstuff.io
ExploreTutorialsProblemsCS Subjects
Get Started
ExploreTutorialsProblemsCS Subjects
Get Started
codingstuff.io

Master the art of building software through interactive tutorials, real-world problems, and guided projects.

Pune, Maharashtra, India

codingstuffmail@gmail.com

Product

  • Explore
  • Tutorials
  • Problems
  • CS Subjects

Company

  • About
  • Contact
  • Privacy Policy
  • Terms & Conditions
  • Sitemap

© 2026 codingstuff.io. All rights reserved.

Built with ❤️ for developers everywhere

/
/
All Subjects
🗄️

DBMS

23 chapters

1Intro & 3-Schema Architecture2ER Model & Diagrams3Generalization, Specialization & Aggregation4Relational Model & Codd's Rules5Relational Algebra6Tuple & Domain Relational Calculus7SQL: DDL, DML, DCL8Advanced SQL (Joins, Aggregates)9Views, Triggers & Stored Procedures10Functional Dependencies11Normalization (1NF, 2NF, 3NF)12BCNF & Lossless Decomposition13Transaction Concepts & ACID14Conflict & View Serializability15Concurrency Control & Locks162-Phase Locking (2PL)17Timestamp-Based Protocols18Indexing (Primary, Clustering)19B-Trees & B+ Trees20Hashing Techniques in DBMS21Database Recovery Techniques22NoSQL Databases Overview23Data Warehousing Concepts
SubjectsDBMS

BCNF & Lossless Decomposition

Updated 2026-05-04
3 min read

BCNF & Lossless Decomposition

While Third Normal Form (3NF) eliminates most redundancies, it has a slight mathematical flaw if the table has multiple overlapping candidate keys. To fix this, Raymond Boyce and Edgar Codd introduced a stricter version of 3NF known as Boyce-Codd Normal Form (BCNF).

1. Boyce-Codd Normal Form (BCNF)

A relation schema $R$ is in BCNF with respect to a set $F$ of functional dependencies if, for all functional dependencies in $F$ of the form $\alpha \rightarrow \beta$ (where $\alpha \subseteq R$ and $\beta \subseteq R$), at least one of the following holds:

  1. $\alpha \rightarrow \beta$ is a trivial functional dependency (i.e., $\beta \subseteq \alpha$)
  2. $\alpha$ is a superkey for schema $R$

The Simple Rule: For every non-trivial functional dependency $X \rightarrow Y$, $X$ must be a superkey. There are absolutely no exceptions.

Why is BCNF stricter than 3NF?

In 3NF, there is a third exception: If $\alpha$ is not a superkey, the dependency is still allowed if $\beta$ is a prime attribute (part of a candidate key). BCNF aggressively removes this exception. If $X$ determines $Y$, $X$ must be a unique key for the whole table.

2. Lossless Join Decomposition

When we normalize a table, we divide it (decompose it) into two or more smaller tables. A critical requirement of normalization is that this decomposition must be lossless.

A decomposition is lossless if we can rejoin the smaller tables (using a Natural Join) and get back exactly the original table—no missing rows, and no "spurious" (fake, extra) rows.

The Rule for Lossless Join

If a relation $R$ is decomposed into $R_1$ and $R_2$, the decomposition is lossless if and only if the common attributes of $R_1$ and $R_2$ form a superkey for at least one of the two tables.

Mathematically, $R_1 \cap R_2$ must be a superkey for $R_1$ OR $R_1 \cap R_2$ must be a superkey for $R_2$.

  • Example: Decomposing Employees (EmpID, Name, DeptID, DeptLocation) into Emp(EmpID, Name, DeptID) and Dept(DeptID, DeptLocation).
  • The common attribute is DeptID.
  • In the Dept table, DeptID is the primary key (a superkey).
  • Therefore, this is a valid, lossless decomposition!

3. Dependency Preservation

While we always want lossless decomposition, we also strive for Dependency Preservation.

A decomposition preserves dependencies if all the original functional dependencies can still be enforced by looking at the individual tables without having to join them back together.

The BCNF Trade-off: It is mathematically proven that we can always decompose a table into 3NF in a way that is both lossless and dependency-preserving. However, we cannot guarantee this for BCNF. Sometimes, achieving BCNF forces us to lose a dependency. This is why many DBAs stop at 3NF.



PreviousNormalization (1NF, 2NF, 3NF)NextTransaction Concepts & ACID

Recommended Gear

Normalization (1NF, 2NF, 3NF)Transaction Concepts & ACID