Algorithm Search⌘K

Definitioncore

Multivalued dependency

Also called MVD.

X ->> Y holds when, for each value of X, the Y values and the values of the other attributes combine freely as a cross product.

A multivalued dependency X↠YX \twoheadrightarrow Y says that, within each group of tuples with the same XX value, the YY values are independent of the values of the remaining attributes. It is the exact condition under which a relation splits without loss into two projections that share XX, by Heath's theorem in Fagin's form. The normalization page uses MVDs only as the reason for 4NF, and BCNF sees only functional dependencies. This page defines MVDs, gives their equivalent forms and the rules for reasoning with them, and shows how they differ from FDs.

Definition

Let UU be a finite set of attributes, let X,Y⊆UX, Y \subseteq U, and let Z=U−XYZ = U - XY, where XYXY means X∪YX \cup Y. We use set semantics: a relation over UU is a finite set of tuples.

Definition (Fagin 1977). A relation rr over UU satisfies the multivalued dependency X↠YX \twoheadrightarrow Y if for any two tuples u,v∈ru, v \in r with u[X]=v[X]u[X] = v[X], there is a tuple w∈rw \in r with

w[XY]=u[XY]andw[Z]=v[Z].w[XY] = u[XY] \quad\text{and}\quad w[Z] = v[Z].

Applied to the pair (v,u)(v, u) as well, the rule asks for both "swaps" of the YY part and the ZZ part of two tuples that agree on XX.

Equivalent forms. For a relation rr over UU, the following are equivalent:

  1. rr satisfies X↠YX \twoheadrightarrow Y.
  2. r=πXY(r)⋈πXZ(r)r = \pi_{XY}(r) \bowtie \pi_{XZ}(r). This is Fagin's theorem, proved on the Heath's theorem page.
  3. For each value xx of XX in rr, with rx={t∈r:t[X]=x}r_x = \{t \in r : t[X] = x\}, the set of pairs {(t[Y−X],t[Z]):t∈rx}\{(t[Y - X], t[Z]) : t \in r_x\} equals πY−X(rx)×πZ(rx)\pi_{Y - X}(r_x) \times \pi_Z(r_x). The YY values and the ZZ values that occur with xx combine as a full cross product.

Form 2 says that an MVD is the join dependency ⋈[XY,XZ]\bowtie[XY, XZ] with two components. Form 3 gives the name: XX determines a set of YY values, not one value, and that set does not depend on the rest of the tuple.

Trivial MVDs. X↠YX \twoheadrightarrow Y is trivial if Y⊆XY \subseteq X or XY=UXY = U. A trivial MVD holds in every relation over UU: for Y⊆XY \subseteq X take w=vw = v, and for XY=UXY = U take w=uw = u. Every other MVD fails in some relation with two tuples.

Dependence on the whole schema. Whether X↠YX \twoheadrightarrow Y holds depends on ZZ, so on all of UU, while an FD X→YX \to Y involves only the attributes in XYXY. If rr satisfies X↠YX \twoheadrightarrow Y and X⊆V⊆UX \subseteq V \subseteq U, then πV(r)\pi_V(r) satisfies X↠Y∩VX \twoheadrightarrow Y \cap V: restrict uu, vv and ww to VV. The other way fails: on V=XYV = XY the MVD X↠YX \twoheadrightarrow Y is trivial, so it holds in πXY(r)\pi_{XY}(r) for every rr, also when it fails in rr. An MVD that is required only on a projection, πXYW(r)⊨X↠Y\pi_{XYW}(r) \models X \twoheadrightarrow Y, is called an embedded MVD, and it is a different and harder kind of constraint.

Examples and non-examples

  • Independent facts. CTB(C,T,B)\mathrm{CTB}(C, T, B) lists, for each course, its teachers and its textbooks, which are chosen independently. The relation
    {(db,Smith,Ullman), (db,Smith,Date), (db,Jones,Ullman), (db,Jones,Date)}\{(\mathit{db}, \mathit{Smith}, \mathit{Ullman}),\ (\mathit{db}, \mathit{Smith}, \mathit{Date}),\ (\mathit{db}, \mathit{Jones}, \mathit{Ullman}),\ (\mathit{db}, \mathit{Jones}, \mathit{Date})\}
    satisfies C↠TC \twoheadrightarrow T and, by complementation, C↠BC \twoheadrightarrow B. No nontrivial FD holds. Each teacher is stored once for each book, which is the redundancy that 4NF removes.
  • Non-example: one tuple missing. Remove (db,Jones,Date)(\mathit{db}, \mathit{Jones}, \mathit{Date}). Then u=(db,Jones,Ullman)u = (\mathit{db}, \mathit{Jones}, \mathit{Ullman}) and v=(db,Smith,Date)v = (\mathit{db}, \mathit{Smith}, \mathit{Date}) agree on CC, but no tuple has Jones with Date, so C↠TC \twoheadrightarrow T fails, and so does C↠BC \twoheadrightarrow B.
  • Every FD is an MVD. If rr satisfies X→YX \to Y and u[X]=v[X]u[X] = v[X], then w=vw = v has w[Y]=u[Y]w[Y] = u[Y], so rr satisfies X↠YX \twoheadrightarrow Y. The converse fails, as CTB\mathrm{CTB} shows.
  • A larger right side does not give a smaller one. Over U=ABCDU = ABCD, the relation
    {(a,b1,c1,d1), (a,b2,c2,d2), (a,b1,c1,d2), (a,b2,c2,d1)}\{(a, b_1, c_1, d_1),\ (a, b_2, c_2, d_2),\ (a, b_1, c_1, d_2),\ (a, b_2, c_2, d_1)\}
    satisfies A↠BCA \twoheadrightarrow BC and A↠DA \twoheadrightarrow D, but not A↠BA \twoheadrightarrow B and not A↠CA \twoheadrightarrow C: the first two tuples would need (a,b1,c2,d2)(a, b_1, c_2, d_2). For FDs, A→BCA \to BC implies A→BA \to B. For MVDs this decomposition rule fails. Its projection on ABDABD does satisfy A↠BA \twoheadrightarrow B, as the rule for projections says.
  • Trivial cases. AB↠AAB \twoheadrightarrow A and A↠BCDA \twoheadrightarrow BCD over ABCDABCD hold in every relation.
  • Inference rules (Beeri, Fagin and Howard 1977). With Z=U−XYZ = U - XY, the rules below, together with Armstrong's axioms for FDs, are sound and complete for implication of FDs and MVDs together:

    • complementation: from X↠YX \twoheadrightarrow Y infer X↠U−XYX \twoheadrightarrow U - XY;
    • reflexivity: if Y⊆XY \subseteq X, infer X↠YX \twoheadrightarrow Y;
    • augmentation: from X↠YX \twoheadrightarrow Y and V⊆WV \subseteq W infer XW↠YVXW \twoheadrightarrow YV;
    • transitivity: from X↠YX \twoheadrightarrow Y and Y↠WY \twoheadrightarrow W infer X↠W−YX \twoheadrightarrow W - Y;
    • replication: from X→YX \to Y infer X↠YX \twoheadrightarrow Y;
    • coalescence: from X↠YX \twoheadrightarrow Y, W→VW \to V, V⊆YV \subseteq Y and W∩Y=∅W \cap Y = \emptyset infer X→VX \to V.

    From these follow the union, intersection and difference rules: from X↠YX \twoheadrightarrow Y and X↠WX \twoheadrightarrow W infer X↠YWX \twoheadrightarrow YW, X↠Y∩WX \twoheadrightarrow Y \cap W and X↠Y−WX \twoheadrightarrow Y - W.

  • Dependency basis (Beeri 1980). For a set DD of FDs and MVDs and a set XX, the sets YY with D⊨X↠YD \models X \twoheadrightarrow Y are closed under union, intersection and difference, so the sets Y−XY - X among them are the unions of the blocks of one partition of U−XU - X. This partition is the dependency basis of XX. Beeri computes it in polynomial time, which decides implication of an MVD or an FD by DD. The chase decides the same question with a tableau.

  • Join dependency. An MVD is the two-component case of a join dependency. Some relations are the join of three projections but satisfy no nontrivial MVD.

  • Tuple-generating dependency. An MVD asks for a tuple ww built from uu and vv, so it is a full tuple-generating dependency. An FD asks for equal values, so it is an equality-generating dependency.

  • Fourth normal form. A schema is in 4NF if the left side of each nontrivial MVD that holds is a superkey.

References

  1. 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 multivalued dependencies, the lossless split into XY and XZ, and fourth normal form
  2. Catriel Beeri, Ronald Fagin and John H. Howard, A complete axiomatization for functional and multivalued dependencies in database relations, Proceedings of the 1977 ACM SIGMOD International Conference on Management of Data, 47 to 61 (1977), the inference rules for FDs and MVDs together and their completeness
  3. 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 dependency basis and a polynomial-time test for implication of FDs and MVDs
  4. Serge Abiteboul, Richard Hull and Victor Vianu, Foundations of Databases, Addison-Wesley (1995), Chapter 8 (functional and join dependency), multivalued dependencies, their inference rules 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.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/X1WTJN/text.yaml