04.06.2015 Views

Database Modeling and Design

Database Modeling and Design

Database Modeling and Design

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

128 CHAPTER 6 Normalization<br />

then the instance also contains the pair of rows obtained by interchanging<br />

the Y values in the original pair. This includes situations<br />

where only pairs of rows exist. Note that X <strong>and</strong> Y may contain either<br />

single or composite attributes.<br />

An MVD X ->> Y is trivial if Y is a subset of X, or if X union Y = RS.<br />

Finally, an FD implies an MVD, which implies that a single row with a<br />

given value of X is also an MVD, albeit a trivial form.<br />

The following examples show where an MVD does <strong>and</strong> does not<br />

exist in a table. In R1, the first four rows satisfy all conditions for the<br />

MVDs X->>Y <strong>and</strong> X->>Z. Note that MVDs appear in pairs because of the<br />

cross-product type of relationship between Y <strong>and</strong> Z=RS-Y as the two<br />

right sides of the two MVDs. The fifth <strong>and</strong> sixth rows of R1 (when the X<br />

value is 2) satisfy the row interchange conditions in the above definition.<br />

In both rows, the Y value is 2, so the interchanging of Y values is<br />

trivial. The seventh row (3,3,3) satisfies the definition trivially.<br />

In table R2, however, the Y values in the fifth <strong>and</strong> sixth rows are different<br />

(1 <strong>and</strong> 2), <strong>and</strong> interchanging the 1 <strong>and</strong> 2 values for Y results in a<br />

row (2,2,2) that does not appear in the table. Thus, in R2 there is no<br />

MVD between X <strong>and</strong> Y or between X <strong>and</strong> Z, even though the first four<br />

rows satisfy the MVD definition. Note that for the MVD to exist, all rows<br />

must satisfy the criterion for an MVD.<br />

Table R3 contains the first three rows that do not satisfy the criterion<br />

for an MVD, since changing Y from 1 to 2 in the second row results<br />

in a row that does not appear in the table. Similarly, changing Z from 1<br />

to 2 in the third row results in a nonappearing row. Thus, R3 does not<br />

have any MVDs between X <strong>and</strong> Y or between X <strong>and</strong> Z.<br />

R1: X Y Z R2: X Y Z R3: X Y Z<br />

1 1 1 1 1 1 1 1 1<br />

1 1 2 1 1 2 1 1 2<br />

1 2 1 1 2 1 1 2 1<br />

1 2 2 1 2 2 2 2 1<br />

2 2 1 2 2 1 2 2 2<br />

2 2 2 2 1 2<br />

3 3 3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!