Multivalued dependency explained

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

R

be a relation schema and let

\alpha\subseteqR

and

\beta\subseteqR

be sets of attributes. The multivalued dependency

\alpha\twoheadrightarrow\beta

("

\alpha

multidetermines

\beta

") holds on

R

if, for any legal relation

r(R)

and all pairs of tuples

t1

and

t2

in

r

such that

t1[\alpha]=t2[\alpha]

, there exist tuples

t3

and

t4

in

r

such that:

\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)

the tuple having values for

\alpha,

\beta,

R-\alpha-\beta

collectively equal to

x,

y,

z

, then whenever the tuples

(a,b,c)

and

(a,d,e)

exist in

r

, the tuples

(a,b,e)

and

(a,d,c)

should also exist in

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}

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:  

\twoheadrightarrow

  and equivalently  

\twoheadrightarrow

 .
Databases with multivalued dependencies thus exhibit redundancy. In database normalization, fourth normal form requires that for every nontrivial multivalued dependency X 

\twoheadrightarrow

 Y, X is a superkey. A multivalued dependency X

\twoheadrightarrow

Y is trivial if Y is a subset of X, or if

X\cupY

is the whole set of attributes of the relation.

Properties

\alpha\twoheadrightarrow\beta

, Then

\alpha\twoheadrightarrowR-\beta

\alpha\twoheadrightarrow\beta

and

\gamma\subseteq\delta

, Then

\alpha\delta\twoheadrightarrow\beta\gamma

\alpha\twoheadrightarrow\beta

and

\beta\twoheadrightarrow\gamma

, then

\alpha\twoheadrightarrow\gamma-\beta

The following also involve functional dependencies:

\alpha\beta

, then

\alpha\twoheadrightarrow\beta

\alpha\twoheadrightarrow\beta

and

\beta\gamma

, then

\alpha\twoheadrightarrow\gamma-\beta

The above rules are sound and complete.

\twoheadrightarrow

 Y holds in R.

Y, then swapping Y's between tuples that agree on X doesn't create new tuples.

\twoheadrightarrow

Y, then X

\twoheadrightarrow

R - Y

\twoheadrightarrow

Y and Z

\subseteq

W, then XW

\twoheadrightarrow

YZ

\twoheadrightarrow

Y and Y

\twoheadrightarrow

Z, then X

\twoheadrightarrow

Z - Y

Y, then X

\twoheadrightarrow

Y

\twoheadrightarrow

Y and

\exist

W s.t. W

\cap

Y =

\empty

, W

Z, and Z

\subseteq

Y, then X

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

R-\beta

.
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.
  • R=\alpha\cup\beta

    . A trivial multivalued dependency implies, for tuples

    t1

    and

    t2

    , tuples

    t3

    and

    t4

    which are equal to

    t1

    and

    t2

    .
    trivial multivalued dependency 2: A multivalued dependency for which

    \beta\subseteq\alpha

    .

    References

    1. Book: Silberschatz, Abraham . Abraham Silberschatz

      . Korth, Sudarshan . Abraham Silberschatz . Database System Concepts . limited . . 5th . 2006 . 295 . 0-07-124476-X.

    External links