emp_skill_lang(ename, skill, language) holds Divya's 2 skills × 3 languages = 6 rows. Show the MVD, decompose to 4NF, and compare what happens when Divya learns Tamil.
Beyond BCNF, redundancy can come from multivalued dependencies — independent multi-valued facts forced into one table — and from join dependencies. 4NF removes non-trivial MVDs whose left side is not a superkey; 5NF (PJNF) removes join dependencies not implied by the keys.
Suppose the office records each employee's skills and the languages they speak in one table emp_skill_lang(ename, skill, language). Divya knows SQL and Python and speaks Malayalam, English and Hindi. Skills and languages are independent facts, so to avoid implying that 'Divya speaks Hindi only when using Python', every skill must be paired with every language.
| ename | skill | language |
|---|---|---|
| Divya | SQL | Malayalam |
| Divya | SQL | English |
| Divya | SQL | Hindi |
| Divya | Python | Malayalam |
| Divya | Python | English |
| Divya | Python | Hindi |
No non-trivial FD holds — ename determines neither a single skill nor a single language — so the only key is {ename, skill, language} and the table is in BCNF. Yet it is plainly redundant: each skill is stored three times and each language twice. Learning a new language (Tamil) forces two inserts, one per skill; forgetting one creates a false fact. The constraint responsible is a multivalued dependency.
Let X and Y be attribute sets of R and Z = R − X − Y. The multivalued dependency X →→ Y ('X multi-determines Y') holds if, whenever two tuples t₁ and t₂ agree on X, the tuples obtained by swapping their Y-values also exist. In other words, for each X value the set of Y values does not depend on Z.
| Rule | Statement |
|---|---|
| Trivial MVD | X →→ Y is trivial if Y ⊆ X or X ∪ Y = R — it holds in every relation |
| Complementation | X →→ Y ⇒ X →→ R − X − Y; so ename →→ skill gives ename →→ language (written ename →→ skill | language) |
| Replication | X → Y ⇒ X →→ Y: every FD is an MVD (one Y value is a trivially independent set) |
| Augmentation | X →→ Y and W ⊇ Z ⇒ WX →→ YZ |
| Transitivity | X →→ Y and Y →→ Z ⇒ X →→ Z − Y |
| Coalescence | X →→ Y, Z ⊆ Y, and W → Z for some W disjoint from Y ⇒ X → Z |
A relation is in fourth normal form if for every non-trivial MVD X →→ Y that holds, X is a superkey. Because every FD is an MVD, a 4NF relation is automatically in BCNF; the textbook shorthand is 'a relation is in 4NF if it is in BCNF and has no (non-trivial) multivalued dependencies'.
In general, an entity with m values of one independent attribute and n of another needs m × n rows in the combined table but only m + n after 4NF decomposition. For Divya (2 skills, 3 languages) that is 6 rows versus 5, and the gap widens quickly: 4 courses and 5 books need 20 rows versus 9.
4NF and 5NF problems are almost always design mistakes made before normalization: two independent multi-valued facts of one entity squeezed into a single table, or a genuine three-way relationship confused with three binary ones. A careful E-R design avoids most of them.
| Dependency | Typical source | E-R view | Cure |
|---|---|---|---|
| FD X → Y | An entity's single-valued attributes stored away from its key | Attribute of the wrong entity | BCNF decomposition |
| MVD X →→ Y | Z | Two independent multivalued attributes (skills, languages) of one entity in one table | Two separate multivalued attributes | One table per multivalued attribute — exactly the E-R mapping rule |
| JD ⋈{AB, BC, CA} | Three binary relationships with a cyclic rule linking them | Three binary relationships, not one ternary | Store the three binary relations |
| Genuine ternary fact | Supplier supplies part to project (no cyclic rule) | One ternary relationship | Keep it as one table — splitting it would be lossy |
The last row matters: a ternary relationship is not automatically a 5NF problem. 'Supplier S supplies part P to project J' generally cannot be rebuilt from the three binary projections, because S may supply P to some projects only. Only when the business rule guarantees reconstruction (the agent–company–product rule below) does the join dependency hold and 5NF demand the split.
A join dependency ⋈{R₁, R₂, …, Rₙ} on R holds if every legal instance of R equals the natural join of its projections onto R₁, …, Rₙ. It is trivial if some Rᵢ equals R. An MVD X →→ Y is exactly the binary join dependency ⋈{XY, XZ}, so join dependencies generalise MVDs to three or more pieces.
Join dependencies arise from cyclic business rules that tie three binary facts together. They are rare in practice and hard to spot from English, which is why 5NF is mostly examined as theory and through one or two standard examples.
A relation is in fifth normal form, also called project–join normal form (PJNF), if every non-trivial join dependency that holds is implied by its candidate keys. Put simply, the relation cannot be split losslessly into smaller projections except in ways the keys already justify.
Classic case: agent–company–product. The rule is 'if an agent represents a company, and the company makes a product, and the agent sells that product, then the agent sells that product for that company'. Here is an instance obeying the rule.
| agent | company | product |
|---|---|---|
| Anu | Tata | Car |
| Anu | Tata | Truck |
| Anu | Maruti | Car |
| Biju | Tata | Car |
| Normal form | Condition (in addition to the previous form) | Removes | Introduced |
|---|---|---|---|
| 1NF | Atomic values, no repeating groups | Nested / multivalued fields | Codd, 1970 |
| 2NF | No non-prime attribute partially dependent on a key | Partial dependencies | Codd, 1971 |
| 3NF | Every non-trivial X → A: X superkey or A prime | Transitive dependencies | Codd, 1971 |
| BCNF | Every non-trivial X → A: X superkey | Remaining FD anomalies | Boyce and Codd, 1974 |
| 4NF | Every non-trivial X →→ Y: X superkey | Independent multivalued facts | Fagin, 1977 |
| 5NF (PJNF) | Every JD implied by the candidate keys | Join-dependency redundancy | Fagin, 1979 |
| DKNF | Every constraint follows from domain and key constraints | All modification anomalies (ideal) | Fagin, 1981 |
| 6NF | No non-trivial join dependencies at all | Used for temporal data | Date, Darwen and Lorentzos, 2003 |
Domain–key normal form (DKNF) is the theoretical ideal: if all constraints are consequences of domain constraints and key constraints, no insertion or deletion anomaly is possible. It cannot always be achieved, so it is a yardstick rather than a target. Most real designs stop at 3NF or BCNF, check for 4NF when independent multi-valued facts appear, and rarely need 5NF.
Two shortcuts help in MCQs. A relation with no non-trivial FDs at all (all-key) is automatically in BCNF, so the question reduces to whether an MVD or JD holds. And Date and Fagin (1992) proved that a BCNF relation with at least one single-attribute candidate key is in 4NF, and a 3NF relation whose candidate keys are all single attributes is in 5NF.
Try the problem first, then reveal the working one step at a time.
emp_skill_lang(ename, skill, language) holds Divya's 2 skills × 3 languages = 6 rows. Show the MVD, decompose to 4NF, and compare what happens when Divya learns Tamil.
Verify that acp(agent, company, product) = {(Anu, Tata, Car), (Anu, Tata, Truck), (Anu, Maruti, Car), (Biju, Tata, Car)}, which obeys the agent–company–product rule, is in 4NF but not in 5NF.
In study(student, course, hobby) the tuples are (Ravi, DBMS, Chess), (Ravi, OS, Music), (Ravi, DBMS, Music). Does student →→ course hold?
A teacher teaches 4 courses and uses 3 books, the two lists being independent. How many tuples does teaches(teacher, course, book) need for this teacher, and how many tuples in total after 4NF decomposition?
In R(A, B, C) classify each MVD as trivial or non-trivial: (a) A →→ BC, (b) AB →→ B, (c) A →→ B, (d) AB →→ C.
Show that if the FD X → Y holds then the MVD X →→ Y holds (the replication rule).
R(A, B, C, D) has key {A, B, C, D} and the MVD A →→ B holds (non-trivially). Is R in BCNF? In 4NF? Decompose it if needed.
Why can a BCNF relation with a single-attribute candidate key never violate 4NF, while an all-key relation can?
10 questions. 70 % passes the topic quiz (+30 XP, +20 more for 100 %). Exam scoring: +1 correct, −⅓ wrong.
Modelled on real KPSC questions (reworded) with the same concept and answer; each links to its original paper.