No history yet

Advanced Normalization Strategies

Beyond the Third Normal Form

You've already seen how the first three normal forms (1NF, 2NF, and 3NF) help clean up data by tackling repeating groups, partial dependencies, and transitive dependencies. They form the foundation of good relational database design. For most everyday applications, reaching 3NF is sufficient to ensure data integrity and minimise redundancy.

However, some complex data relationships can still cause problems even in a 3NF-compliant schema. This is where higher normal forms come into play. They address more subtle and tricky dependencies that can lead to update and deletion anomalies in transactional systems. Let's look at how to identify and resolve these issues.

Boyce-Codd Normal Form (BCNF)

Boyce-Codd Normal Form, or BCNF, is a stricter version of 3NF. A table is in BCNF if for every non-trivial functional dependency, the determinant is a superkey. A determinant is the attribute or set of attributes on the left side of the arrow in a functional dependency (A -> B), and a superkey is any set of attributes that uniquely identifies a row in the table.

This sounds complicated, but the rule is simple: a non-key attribute cannot determine a key attribute. 3NF allows for this in some rare cases, specifically when you have multiple overlapping candidate keys. BCNF closes this loophole.

Consider a table that tracks which professor teaches which course, and each course is taught by only one professor. A professor might teach multiple courses. Professor_Course (ProfessorID, CourseID, Subject)

Let's assume the following dependencies:

  • {ProfessorID, CourseID} is the primary key.
  • ProfessorID -> Subject (A professor teaches only one subject, e.g., Professor Smith always teaches 'History').

Here, ProfessorID is part of the primary key, but it determines another attribute, Subject. The problem is that ProfessorID by itself is not a superkey. This violates BCNF. If Professor Smith decides to teach a new course, we must enter 'History' again, creating redundancy. If she stops teaching her only course, we lose the fact that she is a History professor.

To fix this, we perform a relational decomposition into two tables:

ProfessorIDCourseID
P101C202
P101C305
P203C110
ProfessorIDSubject
P101History
P203Physics

Now, the data is in BCNF. The Professor_Course table shows which professor teaches which course, and the Professor_Subject table stores each professor's subject without repetition. No update anomalies can occur.

Multi-valued Dependencies and 4NF

Fourth Normal Form (4NF) tackles a different kind of problem: multi-valued dependencies. A multi-valued dependency exists when one attribute's value determines a set of values for another attribute, independent of any other attributes.

Imagine a table for a car manufacturing company that stores which models are available with which engine types and which interior colour options. A single model (like 'Explorer') can have multiple engine options (V6, Hybrid) and multiple interior colours (Black, Tan), and these two sets of options are independent of each other. A V6 engine doesn't restrict you to only a black interior.

This leads to a table like this:

ModelEngineInterior
ExplorerV6Black
ExplorerV6Tan
ExplorerHybridBlack
ExplorerHybridTan
BroncoV4Grey

This table is in BCNF because there are no non-trivial functional dependencies; the primary key is {Model, Engine, Interior}. However, it's full of redundancy. To add a new engine option for the Explorer, you'd have to add multiple rows, one for each available interior colour. This is a classic sign of a multi-valued dependency.

We can represent these as: Model ->> Engine (Model determines a set of Engines) Model ->> Interior (Model determines a set of Interiors)

To achieve 4NF, we must separate these independent facts into their own tables:

Now, to find all options for the 'Explorer', you query each table separately and combine the results. This eliminates redundancy and prevents update anomalies. A table is in 4NF if it is in BCNF and has no multi-valued dependencies.

Join Dependencies and 5NF

Fifth Normal Form (5NF), also known as Project-Join Normal Form (PJ/NF), is the highest level of normalization. It deals with a rare anomaly called a join dependency. A join dependency exists if a table can be decomposed into multiple smaller tables and then be perfectly reconstructed by joining them all back together.

If you can decompose a table into just two pieces losslessly, it's a multi-valued dependency situation (4NF). But if it requires three or more pieces to be joined to reconstruct the original, it's a join dependency.

Consider a table showing which suppliers provide which parts to which projects.

SupplierPartProject
S1P1J1
S1P2J1
S2P1J1
S1P1J2

Let's add a business rule: if supplier S supplies part P, and project J needs part P, and supplier S supplies for project J, then supplier S must supply part P for project J. This complex, cyclical constraint creates a join dependency.

If we decompose this table into any two of its possible projections (Supplier_Part, Part_Project, Supplier_Project), we get 'spurious tuples' when we join them back. For example, joining Supplier_Part and Part_Project would incorrectly suggest that S2 supplies P1 for project J2, which is not in the original table.

To be in 5NF, the table must be decomposed into three separate tables:

  • Supplier_Part (Supplier, Part)
  • Part_Project (Part, Project)
  • Supplier_Project (Supplier, Project)

Joining all three together will now losslessly reconstruct the original table without creating any false rows. A table is in 5NF if every join dependency in it is implied by its candidate keys. In practice, spotting and resolving join dependencies is rare and often complex. For most transactional systems, BCNF or 4NF is more than enough to ensure robust design.

Now that you have a solid grasp of these advanced normalization forms, let's test your understanding.

Quiz Questions 1/5

What is the primary difference that makes Boyce-Codd Normal Form (BCNF) stricter than Third Normal Form (3NF)?

Quiz Questions 2/5

A table is in BCNF and contains no multi-valued dependencies. Therefore, the table is also in 4NF.