Multivalued dependency

From HandWiki

In database theory, a multivalued dependency is a full constraint between two sets of attributes in a relation. In contrast to the functional dependency, the multivalued dependency requires that certain tuples be present in a relation. Therefore, a multivalued dependency is a special case of tuple-generating dependency. The multivalued dependency plays a role in the 4NF database normalization.

A multivalued dependency is a special case of a join dependency, with only two sets of values involved, i.e. it is a binary join dependency.

A multivalued dependency exists when there are at least three attributes (like X,Y and Z) in a relation and for a value of X there is a well defined set of values of Y and a well defined set of values of Z. However, the set of values of Y is independent of set Z and vice versa.

Formal definition

The formal definition is as follows:[1]

Let [math]\displaystyle{ R }[/math] be a relation and let [math]\displaystyle{ \alpha \subseteq R }[/math] and [math]\displaystyle{ \beta \subseteq R }[/math] be sets of attributes. The multivalued dependency [math]\displaystyle{ \alpha \twoheadrightarrow \beta }[/math] ("[math]\displaystyle{ \alpha }[/math] multidetermines [math]\displaystyle{ \beta }[/math]") holds on [math]\displaystyle{ R }[/math] if, for any legal relation [math]\displaystyle{ r(R) }[/math] and all pairs of tuples [math]\displaystyle{ t _1 }[/math] and [math]\displaystyle{ t _2 }[/math] in [math]\displaystyle{ r }[/math] such that [math]\displaystyle{ t _1[\alpha]=t _2[\alpha] }[/math], there exist tuples [math]\displaystyle{ t _3 }[/math] and [math]\displaystyle{ t _4 }[/math] in [math]\displaystyle{ r }[/math] such that:

[math]\displaystyle{ \begin{matrix} t_1[\alpha] = t_2[\alpha] = t_3[\alpha] = t_4[\alpha]\\ t_1[\beta] = t_3[\beta]\\ t_2[\beta] = t_4[\beta]\\ t_1[R\setminus(\alpha\cup\beta)] = t_4[R\setminus(\alpha\cup\beta)]\\ t_2[R\setminus(\alpha\cup\beta)] = t_3[R\setminus(\alpha\cup\beta)] \end{matrix} }[/math]

Informally, if one denotes by [math]\displaystyle{ (x,y,z) }[/math] the tuple having values for [math]\displaystyle{ \alpha, }[/math] [math]\displaystyle{ \beta, }[/math] [math]\displaystyle{ R - \alpha - \beta }[/math] collectively equal to [math]\displaystyle{ x, }[/math] [math]\displaystyle{ y, }[/math] [math]\displaystyle{ z }[/math], then whenever the tuples [math]\displaystyle{ (a,b,c) }[/math] and [math]\displaystyle{ (a,d,e) }[/math] exist in [math]\displaystyle{ r }[/math], the tuples [math]\displaystyle{ (a,b,e) }[/math] and [math]\displaystyle{ (a,d,c) }[/math] should also exist in [math]\displaystyle{ r }[/math].

The multivalued dependency can be schematically depicted as shown below:

[math]\displaystyle{ \begin{matrix} \text{tuple} & \alpha & \beta & R\setminus(\alpha\cup\beta) \\ t_1 & a_1 .. a_n & b_1 .. b_m & d_1 .. d_k \\ t_2 & a_1 .. a_n & c_1 .. c_m & e_1 .. e_k \\ t_3 & a_1 .. a_n & b_1 .. b_m & e_1 .. e_k \\ t_4 & a_1 .. a_n & c_1 .. c_m & d_1 .. d_k \end{matrix} }[/math]

Example

Consider this example of a relation of university courses, the books recommended for the course, and the lecturers who will be teaching the course:

University courses
Course Book Lecturer
AHA Silberschatz John D
AHA Nederpelt John D
AHA Silberschatz William M
AHA Nederpelt William M
AHA Silberschatz Christian G
AHA Nederpelt Christian G
OSO Silberschatz John D
OSO Silberschatz William M

Because the lecturers attached to the course and the books attached to the course are independent of each other, this database design has a multivalued dependency; if we were to add a new book to the AHA course, we would have to add one record for each of the lecturers on that course, and vice versa.
Put formally, there are two multivalued dependencies in this relation: {course} [math]\displaystyle{ \twoheadrightarrow }[/math] {book} and equivalently {course} [math]\displaystyle{ \twoheadrightarrow }[/math] {lecturer}.
Databases with multivalued dependencies thus exhibit redundancy. In database normalization, fourth normal form requires that for every nontrivial multivalued dependency X [math]\displaystyle{ \twoheadrightarrow }[/math] Y, X is a superkey. A multivalued dependency X [math]\displaystyle{ \twoheadrightarrow }[/math] Y is trivial if Y is a subset of X, or if [math]\displaystyle{ X \cup Y }[/math] is the whole set of attributes of the relation.

Properties

  • If [math]\displaystyle{ \alpha \twoheadrightarrow \beta }[/math], Then [math]\displaystyle{ \alpha \twoheadrightarrow R - \beta }[/math]
  • If [math]\displaystyle{ \alpha \twoheadrightarrow \beta }[/math] and [math]\displaystyle{ \gamma \subseteq \delta }[/math], Then [math]\displaystyle{ \alpha \delta \twoheadrightarrow \beta \gamma }[/math]
  • If [math]\displaystyle{ \alpha \twoheadrightarrow \beta }[/math] and [math]\displaystyle{ \beta \twoheadrightarrow \gamma }[/math], then [math]\displaystyle{ \alpha \twoheadrightarrow \gamma - \beta }[/math]

The following also involve functional dependencies:

  • If [math]\displaystyle{ \alpha \rightarrow \beta }[/math], then [math]\displaystyle{ \alpha \twoheadrightarrow \beta }[/math]
  • If [math]\displaystyle{ \alpha \twoheadrightarrow \beta }[/math] and [math]\displaystyle{ \beta \rightarrow \gamma }[/math], then [math]\displaystyle{ \alpha \twoheadrightarrow \gamma - \beta }[/math]

The above rules are sound and complete.

  • A decomposition of R into (XY) and (XR − Y) is a lossless-join decomposition if and only if X [math]\displaystyle{ \twoheadrightarrow }[/math] Y holds in R.
  • Every FD is an MVD because if X [math]\displaystyle{ \rightarrow }[/math] Y, then swapping Y's between tuples that agree on X doesn't create new tuples.
  • Splitting Doesn't Hold. Like FD's, we cannot generally split the left side of an MVD.But unlike FD's, we cannot split the right side either, sometimes you have to leave several attributes on the right side.
  • Closure of a set of MVDs is the set of all MVDs that can be inferred using the following rules (Armstrong's axioms):
    • Complementation: If X [math]\displaystyle{ \twoheadrightarrow }[/math] Y, then X [math]\displaystyle{ \twoheadrightarrow }[/math] R - Y
    • Augmentation: If X [math]\displaystyle{ \twoheadrightarrow }[/math] Y and Z [math]\displaystyle{ \subseteq }[/math] W, then XW [math]\displaystyle{ \twoheadrightarrow }[/math] YZ
    • Transitivity: If X [math]\displaystyle{ \twoheadrightarrow }[/math] Y and Y [math]\displaystyle{ \twoheadrightarrow }[/math]Z, then X [math]\displaystyle{ \twoheadrightarrow }[/math] Z - Y
    • Replication: If X [math]\displaystyle{ \rightarrow }[/math] Y, then X [math]\displaystyle{ \twoheadrightarrow }[/math] Y
    • Coalescence: If X [math]\displaystyle{ \twoheadrightarrow }[/math]Y and [math]\displaystyle{ \exist }[/math] W s.t. W [math]\displaystyle{ \cap }[/math] Y = [math]\displaystyle{ \empty }[/math], W [math]\displaystyle{ \rightarrow }[/math] Z, and Z [math]\displaystyle{ \subseteq }[/math] Y, then X [math]\displaystyle{ \rightarrow }[/math] Z

Definitions

full constraint
A constraint which expresses something about all attributes in a database. (In contrast to an embedded constraint.) That a multivalued dependency is a full constraint follows from its definition, as where it says something about the attributes [math]\displaystyle{ R - \beta }[/math].
tuple-generating dependency
A dependency which explicitly requires certain tuples to be present in the relation.
trivial multivalued dependency 1
A multivalued dependency which involves all the attributes of a relation i.e.[math]\displaystyle{ R = \alpha \cup \beta }[/math]. A trivial multivalued dependency implies, for tuples [math]\displaystyle{ t _1 }[/math] and [math]\displaystyle{ t _2 }[/math], tuples [math]\displaystyle{ t _3 }[/math] and [math]\displaystyle{ t _4 }[/math] which are equal to [math]\displaystyle{ t _1 }[/math] and [math]\displaystyle{ t _2 }[/math].
trivial multivalued dependency 2
A multivalued dependency for which [math]\displaystyle{ \beta \subseteq \alpha }[/math].

References

  1. Silberschatz, Abraham; Korth, Sudarshan (2006). Database System Concepts (5th ed.). McGraw-Hill. p. 295. ISBN 0-07-124476-X. https://archive.org/details/databasesystemco00silb_827. 

External links