Professional Documents
Culture Documents
1 DBMS
Fall 2013
Suggested Solution to Final Examination
(1)
}
}
$mysqli->close();
?>
</body>
</html>
(2)
implies
AD-> F
Proof: For example:
[1] A-> B (given)
[2] AA->AB (augmentation of A on [1])
[3] A->AB (simplification of [2])
[4] AB->C (given)
[5] A-> C (transitivity on [3] and [4])
[6] AD->CD (augmentation of D on [5])
[7] CD -> E (given)
[8] AD -> E (transitivity on [6] and [7])
[9] DE-> F (given)
[10] ADD-> F (pseudo-transitivity on [8] and [7])
[11] AD->F (simplification of [10])
QED.
(3) Yes, the decomposition is lossless.
Given {AD->C, DB->AE, E->CD}. For R to decompose into R1(A,B,D,E), R2(B,C,D)
and R3(C,D,E):
(a) The decomposition of R into R3(C,D,E) and R(A,B,C,D,E) is lossless since the
common attributes are CDE and CDE -> in R3.
(b) The further decomposition of R into R1(A,B,D,E) and R2(B,C,D) is also lossless
since the common attributes are BD and both BD->AE in R1.
Alternatively, you can use the algorithm for checking for lossless decomposition
below.
Given {AD->C, DB->AE, E->CD}. For R to decompose into R1(A,B,D,E), R2(B,C,D)
and R3(C,D,E):
R1
b(1,1)
b(1,2)
b(1,3)
b(1,4)
b(1,5)
R2
b(2,1)
b(2,2)
b(2,3)
b(2,4)
b(2,5)
R3
b(3,1)
b(3,2)
b(3,3)
b(3,4)
b(3,5)
Step 2. For each relation Ri, set all attribute Aj that appears in Ri from b(i,j) to a(j).
Relation
R1
a(1)
a(2)
b(1,3)
a(4)
a(5)
R2
b(2,1)
a(2)
a(3)
a(4)
b(2,5)
R3
b(3,1)
b(3,2)
a(3)
a(4)
a(5)
Step 3. For each FD X-> Y, if two rows have the common X values, for every
attribute W in Y:
R1
a(1)
a(2)
b(1,3)
a(4)
a(5)
R2
b(2,1)
a(2)
a(3)
a(4)
a(5)
R3
b(3,1)
b(3,2)
a(3)
a(4)
a(5)
R1
a(1)
a(2)
b(1,3)
a(4)
a(5)
R2
a(1)
a(2)
a(3)
a(4)
a(5)
R3
b(3,1)
b(3,2)
a(3)
a(4)
a(5)
Applying DB->AE:
Relation
(a)
(b)
(c)
(d)
(e)