Definitionadvanced
Join dependency
Also called JD.
A constraint that a relation equals the natural join of its projections on given sets of attributes; an MVD is the case of two sets.
A join dependency says that a relation is the natural join of its projections on some given sets of attributes, so it can be stored as those projections and rebuilt without loss. A multivalued dependency is the case of two sets, and join dependencies with three or more sets express constraints that no MVD or FD can. The normalization page mentions them only as the basis of 5NF, and BCNF does not see them at all. This page defines join dependencies, shows when they are trivial and how they relate to MVDs, and gives the standard example.
Definition
Let be a finite set of attributes and let with . We use set semantics.
Definition. A relation over satisfies the join dependency (JD) if
Each tuple of is in the join of its own projections, so the condition is that the join adds no tuple. In tuple form: for any and any tuple over with for each , also . So a JD is a full tuple-generating dependency. The sets are the components, and they form a hypergraph on .
Trivial JDs. holds in every relation over if and only if some .
Proof. If , each tuple of the join has . If no is , let have the tuples with the value on and the value elsewhere. Each is on , so the all- tuple is in the join. It is not in , since each has a value outside .
Two components are an MVD. With , the JD is the MVD , by Fagin's theorem (see Heath's theorem). Conversely, is the JD .
Merging components weakens a JD. If satisfies , it satisfies . Proof. A tuple of the second join has , so and , and is in the first join, which is . So a JD implies each MVD that comes from a split of its components into two groups. A component contained in another one can be dropped without changing the JD.
Implication. A set of FDs and JDs implies a JD if every relation that satisfies satisfies . The chase decides this (Maier, Mendelzon and Sagiv 1979), with a start tableau of one row per component of . With FDs only in , this is the tableau test for a lossless join, which runs in polynomial time. With JDs in , the tableau can grow, and the chase page gives what is known about the cost.
Examples and non-examples
- A three-way rule. with supplier, part and project, and the rule: if supplier supplies part , part is used in project , and supplies project , then supplies to . This is the JD . The relation
satisfies it. The first three tuples give , and , and the fourth tuple is the one the rule asks for.
- Non-example: one tuple missing. Remove . The projections on , and still contain , and , so the join of the three projections has the spurious tuple , and the JD fails.
- A JD that is not an MVD. implies no nontrivial MVD over . The chase of each of the twelve nontrivial MVDs over three attributes, to , with this JD, ends without an all- row. Each split of its components into two groups gives a component equal to , a trivial JD, which agrees with the merging rule. So no lossless split into two projections explains , but the split into three does.
- MVDs as JDs. In , the MVD is the JD .
- Trivial JDs. over holds in every relation, because one component is all of .
Related definitions
- Fifth normal form. A schema is in 5NF when each JD that holds is implied by the candidate keys. with its JD is in 4NF and not in 5NF.
- Acyclic JDs. If the hypergraph of the components is acyclic, the JD is equivalent to a set of MVDs (Beeri, Fagin, Maier and Yannakakis 1983). The hypergraph of is a triangle, which is cyclic, and indeed no set of MVDs is equivalent to it.
- Lossless decomposition. A decomposition of is lossless under exactly when implies . See the lossless join page.
- Embedded JDs. If is a proper subset of , the JD is required only of the projection on that union. Such embedded dependencies behave differently, and the chase need not stop for them.
- Ternary relationships. A relationship set of degree three in the ER model is in general not the join of its binary projections. When it is, the JD lets the designer replace it by binary relationships.
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), join dependencies and project-join normal form
- Alfred V. Aho, Catriel Beeri and Jeffrey D. Ullman, The theory of joins in relational databases, ACM Transactions on Database Systems 4(3), 297 to 314 (1979), lossless joins of several projections and the tableau test
- 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 decides implication of functional and join dependencies
- Catriel Beeri, Ronald Fagin, David Maier and Mihalis Yannakakis, On the desirability of acyclic database schemes, Journal of the ACM 30(3) (1983), a join dependency with an acyclic hypergraph is equivalent to a set of multivalued dependencies
- Serge Abiteboul, Richard Hull and Victor Vianu, Foundations of Databases, Addison-Wesley (1995), Chapter 8 (functional and join dependency), join dependencies and the chase
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 0MG279 Edit this page History Report an error Markdown