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.
The formal definition is as follows:[1]
Let
R
\alpha\subseteqR
\beta\subseteqR
\alpha\twoheadrightarrow\beta
\alpha
\beta
R
r(R)
t1
t2
r
t1[\alpha]=t2[\alpha]
t3
t4
r
\begin{matrix} t1[\alpha]=t2[\alpha]=t3[\alpha]=t4[\alpha]\\ t1[\beta]=t3[\beta]\\ t2[\beta]=t4[\beta]\\ t1[R\setminus(\alpha\cup\beta)]=t4[R\setminus(\alpha\cup\beta)]\\ t2[R\setminus(\alpha\cup\beta)]=t3[R\setminus(\alpha\cup\beta)] \end{matrix}
Informally, if one denotes by
(x,y,z)
\alpha,
\beta,
R-\alpha-\beta
x,
y,
z
(a,b,c)
(a,d,e)
r
(a,b,e)
(a,d,c)
r
The multivalued dependency can be schematically depicted as shown below:
\begin{matrix} tuple&\alpha&\beta&R\setminus(\alpha\cup\beta)\\ t1&a1..an&b1..bm&d1..dk\\ t2&a1..an&c1..cm&e1..ek\\ t3&a1..an&b1..bm&e1..ek\\ t4&a1..an&c1..cm&d1..dk \end{matrix}
Consider this example of a relation of university courses, the books recommended for the course, and the lecturers who will be teaching the course:
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:
\twoheadrightarrow
\twoheadrightarrow
\twoheadrightarrow
\twoheadrightarrow
X\cupY
\alpha\twoheadrightarrow\beta
\alpha\twoheadrightarrowR-\beta
\alpha\twoheadrightarrow\beta
\gamma\subseteq\delta
\alpha\delta\twoheadrightarrow\beta\gamma
\alpha\twoheadrightarrow\beta
\beta\twoheadrightarrow\gamma
\alpha\twoheadrightarrow\gamma-\beta
\alpha → \beta
\alpha\twoheadrightarrow\beta
\alpha\twoheadrightarrow\beta
\beta → \gamma
\alpha\twoheadrightarrow\gamma-\beta
The above rules are sound and complete.
\twoheadrightarrow
→
\twoheadrightarrow
\twoheadrightarrow
\twoheadrightarrow
\subseteq
\twoheadrightarrow
\twoheadrightarrow
\twoheadrightarrow
\twoheadrightarrow
→
\twoheadrightarrow
\twoheadrightarrow
\exist
\cap
\empty
→
\subseteq
→
R-\beta
R=\alpha\cup\beta
t1
t2
t3
t4
t1
t2
\beta\subseteq\alpha
. Korth, Sudarshan . Abraham Silberschatz . Database System Concepts . limited . . 5th . 2006 . 295 . 0-07-124476-X.