7.1 Binary Decomposition
7.1 Binary Decomposition
7.1 Binary Decomposition
1
Binary Decomposition - 1
2
Binary Decomposition - 2
3
Binary Decomposition - 3
4
Binary Decomposition - 4
Binary Decomposition:
Lossless-join
May not be dependency preserving. If so, then
add extra relations XA, one for each FD X A
we lost
Synthesis Approach
Dependency preservation
May not be lossless-join. If so, we need to add to
R one extra relation schema that includes the
attributes that form any key of R
7
Question #1
Consider R = {A, B, C, D, E, F, G, H} with a set of
FDs
F = {CDA, ECH, GHBAB, CD, EGA,
HB, BECD, ECB}
The candidate keys are: {BEFG, CEFG, EFGH}
Is R w.r.t. F in 3NF? If not, decompose it into
relations in 3NF using:
1. Binary Decomposition
2. Synthesis Approach
8
To Check Lossless Join - 1
Suppose relation R{A1 , . . . , Ak} is decomposed
into R1,. . . , Rn
To determine if this decomposition is lossless, we
use a table,
L[ 1 n ] [ 1 . . . k ]
repeat
for each FD X Y in F do:
if rows i and j such that L [ i ] == L [ j ], for each attribute
in X,
then for column t corresponding to an attribute At in Y do:
if L [ i ][ t ] == aAt
then L [ j ][ t ] aAt
else if L [ j ][ t ] == aAt
then L [ i ][ t ] aAt
else L [ j ][ t ] L [ i ][ t ]
until no change
11