Definitionadvanced
Fifth normal form (5NF)
Also called 5NF, project-join normal form.
A schema in which every nontrivial join dependency is implied by the candidate keys, so no lossless split into projections removes redundancy.
Fifth normal form, or project-join normal form, is the normal form of Fagin (1979) for schemas with join dependencies. It asks that every join dependency that holds follows from the candidate keys alone, so a split into projections is lossless only for a reason that also makes it useless. The normalization page places 5NF at the top of the chain of normal forms, and the BCNF page treats the FD case. This page gives the exact definition, a test of a JD against the keys, the proof that 5NF implies 4NF, and one schema for each gap in the chain from 1NF to 5NF.
Definition
Let be a finite set of attributes and a finite set of FDs and JDs over , where an MVD counts as the JD . We use set semantics. Let be the candidate keys of , and let , the key dependencies.
Definition (Fagin 1979; Date's form). is in fifth normal form if every JD that implies is implied by .
Fagin asked the same of the FDs that implies. This adds nothing: the proof below that 5NF implies 4NF shows that each nontrivial implied FD then has a superkey on its left side, and so follows from a key dependency.
Testing a JD against the keys. Let . Repeat: if two components and have for some key , replace them by . Then if and only if this ends with a component equal to .
Proof. Run the chase of the tableau for with the FDs : row has on and the symbol elsewhere. We claim that at each time the rows fall into classes, where all rows of a class are equal, have on the union of their components and a symbol of their own elsewhere. This holds at the start. Two rows of different classes and agree exactly on , where both hold . So applies to them exactly when , and then it makes all their symbols equal, which merges the two classes into one class with union . So the chase performs exactly the merges of the test. It ends with an all- row exactly when some class has , and by the chase theorem this is exactly when .
The test is polynomial once the keys are known. Finding all keys can take exponential time, since there can be exponentially many.
It is enough to check . If each FD of has a superkey on its left side and each JD of passes the test above, then is in 5NF. Proof. implies each member of : an FD with follows from . Also implies . So the two sets imply the same JDs. Superkeys under must be found with an implication test for FDs and JDs, such as the chase.
5NF implies 4NF. Let be in 5NF and let be nontrivial, with . This MVD is the JD , so implies it. holds FDs only, so by Fagin's theorem and the binary test of the lossless join page, or . Both are nontrivial FDs. Every FD of has a key on its left side, so is in BCNF, and the left side of a nontrivial FD that it implies is a superkey. So is in 4NF.
A sufficient condition (Date and Fagin 1992). If is in 3NF and every candidate key has a single attribute, then it is in 5NF.
Examples and non-examples
The strict chain. Each normal form implies the one before it, , and each step is strict:
| in | not in | schema | dependencies | the violation |
|---|---|---|---|---|
| 1NF | 2NF | , | depends on the part of the key | |
| 2NF | 3NF | , | is not a superkey and is not prime | |
| 3NF | BCNF | , | is not a superkey, but is prime | |
| BCNF | 4NF | is not a superkey | ||
| 4NF | 5NF | the JD does not follow from the key |
The pages of 2NF, 3NF and 4NF explain the first four rows. For the last one: the JD implies no FD, because the chase with JDs never makes two symbols equal, so the only key is . The JD implies no nontrivial MVD either, as the join dependency page shows with the chase, so is in 4NF. In the test against the key , no two components contain the key in their intersection, so no merge happens, no component becomes , and the JD is not implied by the keys. The 5NF split is into , and , and each part, with two attributes and no dependency, is in 5NF.
- A JD that the key implies. with employee, name, salary and department, and . The JD holds, and the test merges and on the key , then and , which gives . So the JD follows from the key. The schema is in 5NF, and indeed by Date and Fagin, since it is in 3NF with a single-attribute key. Splitting it into three parts would be lossless but would remove no redundancy.
- No dependencies. With , the only key is , every implied JD is trivial, and the schema is in 5NF.
Related definitions
- Join dependency. The JD page defines join dependencies, their trivial cases and their relation to MVDs.
- 4NF and BCNF. 4NF is 5NF restricted to JDs with two components, and BCNF is the case of FDs. With FDs only, BCNF, 4NF and 5NF agree, because every JD that FDs imply is then implied by the keys.
- Implication of JDs. Deciding whether implies a JD uses the chase. With JDs in the chase can be expensive, which makes 5NF hard to test in general. The test against the keys above is the easy part.
- Lossless decompositions. The split of a schema that violates 5NF uses the components of the violating JD, and it is lossless because the JD holds. The tableau test checks lossless joins under FDs.
References
- Ronald Fagin, Normal forms and relational database operators, Proceedings of the 1979 ACM SIGMOD International Conference on Management of Data, 153 to 160 (1979), project-join normal form, defined by the implication of all dependencies by the key dependencies
- 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 3NF schema in which every key has one attribute is in project-join normal form
- David Maier, Alberto O. Mendelzon and Yehoshua Sagiv, Testing implications of data dependencies, ACM Transactions on Database Systems 4(4), 455 to 469 (1979), the chase for functional and join dependencies, used here for the test of a JD against the keys
- Serge Abiteboul, Richard Hull and Victor Vianu, Foundations of Databases, Addison-Wesley (1995), Chapter 11 (design and dependencies), normal forms for join dependencies
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 PD85QQ Edit this page History Report an error Markdown