Definitioncore
Fourth normal form (4NF)
Also called 4NF.
A schema in which every nontrivial multivalued dependency has a superkey on its left side, which removes redundancy from independent facts.
Fourth normal form is the normal form of Fagin (1977) for schemas with multivalued dependencies as well as functional ones. It asks what BCNF asks of FDs, a superkey on the left side, of every nontrivial MVD. The normalization page places it in the chain of normal forms, and the BCNF page treats the FD case. This page proves that 4NF implies BCNF, that it is enough to check the given dependencies, and that 4NF and BCNF agree when there are no MVDs.
Definition
Let be a finite set of attributes and a finite set of FDs and MVDs over . We use set semantics. A set is a superkey if . An MVD is trivial if or , and then it holds in every relation over .
Definition (Fagin 1977). is in fourth normal form if for each nontrivial MVD with , the set is a superkey.
Each FD gives the MVD by replication, so the FDs of are covered too. With MVDs present, can imply FDs that no rule for FDs alone gives, through the coalescence rule, so superkeys must be found with an implication test for FDs and MVDs together, such as Beeri's dependency basis or the chase, not with the attribute closure under the FDs of only.
4NF implies BCNF. Let be in 4NF, and let with . If , then follows and is a superkey. Otherwise is a nontrivial MVD that implies, by replication, so is a superkey by 4NF. So each nontrivial implied FD has a superkey on its left side, which is BCNF.
It is enough to check . is in 4NF if and only if the left side of each nontrivial MVD of and of each nontrivial FD of is a superkey.
Proof. Only if: each member of is implied by , and a nontrivial FD with gives a nontrivial MVD; if , then is a superkey anyway. If: let be the set of FDs , one for each left side of a nontrivial member of . Each of these is a superkey, so . Each nontrivial member of follows from its FD , and the trivial ones follow from nothing, so . So and imply the same dependencies. Now let be nontrivial, with . Then . By Fagin's theorem (see Heath's theorem), this means that the split into and is lossless for each relation that satisfies . holds FDs only, so by the test of the lossless join page, or . Both FDs are nontrivial, because and are not empty. Every FD of has a superkey on its left side, so is in BCNF, and by the BCNF page, the left side of each nontrivial FD that implies is a superkey. So is a superkey.
With FDs only, 4NF and BCNF agree. If is a set of FDs, then is in 4NF exactly when it is in BCNF. One direction is the proposition above. For the other, BCNF means that each nontrivial FD of has a superkey on its left side, which is the condition of the previous proposition.
4NF decomposition. If a schema violates 4NF with , split it into and . Fagin's theorem shows that the split is lossless. Repeat on the parts with the MVDs that hold on them. The process stops, since the parts get smaller, and it ends with a lossless 4NF decomposition. Like BCNF decomposition, it may not preserve the dependencies.
A sufficient condition (Date and Fagin 1992). If a schema with FDs and MVDs is in BCNF and has at least one candidate key with a single attribute, then it is in 4NF.
Examples and non-examples
- BCNF, not 4NF. with course, teacher and book, and : the teachers and the books of a course are independent. No nontrivial FD follows, so the only key is and the schema is in BCNF. is nontrivial and is not a superkey, so it is not in 4NF. A relation over it stores each teacher of a course once for each book of the course.
- The 4NF split. Splitting on gives and . On each part, and become trivial, and both parts are in 4NF. A course with teachers and books needs tuples instead of .
- An MVD with a key on the left. with employee, name and salary, and . is a key, so every MVD with on the left is allowed. The schema is in BCNF and has a key with one attribute, so it is in 4NF by the result of Date and Fagin.
- Not BCNF, so not 4NF. with violates BCNF with , and violates 4NF.
- No dependencies. With , only trivial MVDs hold and the schema is in 4NF.
Related definitions
- BCNF. BCNF is the same condition for FDs. 4NF implies BCNF, and the two agree when has no MVDs.
- Fifth normal form. 5NF extends the condition to join dependencies and implies 4NF. A schema can be in 4NF and not in 5NF.
- Multivalued dependency. The MVD page gives the definition, its forms and the inference rules used above.
- Lossless split. Heath's theorem, in Fagin's form, is the reason the 4NF split loses nothing.
References
- Ronald Fagin, Multivalued dependencies and a new normal form for relational databases, ACM Transactions on Database Systems 2(3), 262 to 278 (1977), the definition of fourth normal form, the proof that it implies BCNF, and the decomposition into 4NF
- C. J. Date and Ronald Fagin, Simple conditions for guaranteeing higher normal forms in relational databases, ACM Transactions on Database Systems 17(3), 465 to 476 (1992), a BCNF schema with at least one key of one attribute is in 4NF
- Catriel Beeri, On the membership problem for functional and multivalued dependencies in relational databases, ACM Transactions on Database Systems 5(3), 241 to 259 (1980), the polynomial test for implication of FDs and MVDs, which finds the superkeys under a set of FDs and MVDs
- Serge Abiteboul, Richard Hull and Victor Vianu, Foundations of Databases, Addison-Wesley (1995), Chapter 11 (design and dependencies), fourth normal form
- Jeffrey D. Ullman, Principles of Database and Knowledge-Base Systems, Volume I, Computer Science Press (1988), Chapter 7 (design theory for relational databases), multivalued dependencies and fourth normal form
Where this leads
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W4 complete |
|
Tag 9VM6F5 Edit this page History Report an error Markdown