Professional Documents
Culture Documents
DECOMPOSITIONS
WHY LOSSLESS DECOMPOSITION?
Decompositions should always be lossless
Lossless decomposition ensure that the information in
the original relation can be accurately reconstructed
based on the information represented in the decomposed
relations.
It is important to check that decomposition does not lead
to bad design
A good decomposition must not lead to loss of
information (lossy decomposition)
Given instances of the decomposed relations, we may not be
able to reconstruct the corresponding instance of the original
relation – information loss
LOSSLESS DECOMPOSITION DEFINITION
A set
of relation schemas { R1, R2,…,
Rn } is a lossless decomposition of R if
Merge R1 and R3
R1(B,A,C);
R2(CD);
R4(D,E)
BOYCE CODD NORMAL FORM
LOSSLESS JOIN
DECOMPOSITION
BOYCE-CODD NORMAL FORM
R is not in BCNF
LOSSLESS JOIN DECOMPOSITION
ALGORITHM FOR BCNF
Given a universal relation R and a set of functional
dependencies on the attributes of R:
D ←R;
while there is some relation schema S in D that is not
already BCNF
{
Find a functional dependency X→Y in S that violates
BCNF
Replace S by two relation schemas (S-Y) and (X,Y)
}
EXAMPLE
R is not in BCNF
EXERCISE
EmployeeNumber RateCategory
EmployeeNumberHourlyRate
RateCategory HourlyRate
SK= ProjectNumber,EmployeeNumber