Sub topic 18
Multivalued Dependencies and 4NF
Assume you know relations, candidate keys, functional dependencies, and lossless decomposition. This chapter extends those ideas to cases where one entity has multiple independent collections of values.
Multivalued Dependencies
A multivalued dependency (MVD) is written as:
X ->> Y
It means that, for each value of X, the set of Y values is independent of the remaining attributes. If R(X, Y, Z) satisfies X ->> Y, then every valid combination of a Y value and a Z value for the same X must also be present.
Consider:
StudentSkillLanguage(Student, Skill, Language)
A student may know several skills and speak several languages. Suppose skills and languages are independent. If student Ana has skills SQL and Python and speaks English and Spanish, the relation stores all four combinations:
| Student | Skill | Language |
|---|---|---|
| Ana | SQL | English |
| Ana | SQL | Spanish |
| Ana | Python | English |
| Ana | Python | Spanish |
The dependencies are:
Student ->> SkillStudent ->> Language
The candidate key is (Student, Skill, Language), because no smaller attribute set identifies one row. However, the relation repeats independent facts and creates unnecessary combinations.
A trivial MVD is one where Y is contained in X, or where X ∪ Y contains every attribute of the relation. Such dependencies do not require decomposition.
Fourth Normal Form
A relation is in fourth normal form (4NF) if, for every nontrivial MVD X ->> Y, X is a superkey. A superkey is an attribute set that identifies each row uniquely.
StudentSkillLanguage violates 4NF because Student ->> Skill is nontrivial, but Student is not a superkey. Decompose it into:
StudentSkill(Student, Skill)StudentLanguage(Student, Language)
The decomposition removes the independent-value redundancy. Joining the two relations recreates the combinations when those combinations are genuinely implied by the requirements.
A common error is to apply 4NF to an ordinary functional dependency without checking whether the dependency is multivalued. Another error is to decompose values that are actually related. If a particular language is required for a particular skill, the independence assumption is false, and the decomposition would create invalid combinations.
Join Dependencies and 5NF
A join dependency (JD) states that a relation can be reconstructed exactly by joining several projections. It is written:
*(R1, R2, ..., Rn)
For example, Supply(Supplier, Part, Project) might be valid only when supplier-part, supplier-project, and part-project facts together imply the three-way fact. The relation can then be decomposed into:
SupplierPart(Supplier, Part)SupplierProject(Supplier, Project)PartProject(Part, Project)
A relation is in fifth normal form (5NF), also called project-join normal form, when every nontrivial join dependency is implied by candidate keys. 5NF addresses rare redundancy that remains after 4NF. Decomposition must be justified by a real business rule; otherwise, joining projections can produce spurious rows.
Exercise
A relation R(A, B, C) has the nontrivial MVD A ->> B, and A is not a superkey. Is R in 4NF?
Show answer
No. The dependency violates 4NF because the determinant A is not a superkey.