Lecture Notes For DBMS: Decomposition
Lecture Notes For DBMS: Decomposition
Customer-loan
customer-name loan-number amount
Ram L-12 12000
Ram L-13 13000
Now suppose to know the branch for loan L-12 we try to form join of these two we will
a table as follows:
Branch-customer Customer-loan =
branch-name branch-city assets customer-name loan-number amount
Sadar Agra 200000 Ram L-12 12000
Sadar Agra 200000 Ram L-13 13000
Sanjay-place Agra 100000 Ram L-12 12000
Sanjay-place Agra 100000 Ram L-13 13000
According to this join both of the loans are taken from both of the branches. This is an
example of information loss. This occurred because the choice of Column to be kept
common in two tables after decomposition is wrong.
Lossless-Join Decomposition: A decomposition { R1, R2,Rn } of relation schema R is
lossless join decomposition if for all legal relations r on schema R,
r = R1 (r) R1 (r) Rn (r)
In other words after decomposition, when we join all of the decomposed tables with data
it should result in the original table with data as was before decomposition.
Otherwise it is called Lossy-join decomposition.
Dependency preservation: This is another desirable property of a decomposition.
Suppose it is given that a set F of functional dependencies holds on any relation based on
schema R. Then set of functional dependencies that holds on any relation subschema R1
is F1 that contains all the functional dependencies of F which contains attributes of only
R1. So if decomposition of R is { R1, R2,Rn } such that corresponding functional
dependencies which holds on them are { F1, F2,Fn } then following should be true.
F+ = {F1 F2 Fn}+.
Such a decomposition is called dependency preserving decomposition.
For example:
Consider the schema R = {A, B, C, D} such that following functional dependency holds
on it F = {AB, A BC, C D}.
Now suppose the decomposition of this R is R1= {A,B} and R2 = {B,C,D}, so the
functional dependencies which holds on R1 are F1= {AB} (Note: F1 should contain all
the functional dependencies in F which have only attributes of R1) and those on R2 are F2
={CD}. If we union F1 F2 is {AB, C D} which doesnt contain the A BC , so
it is not a dependency preserving decomposition.
If we decompose R into these relation schemas R1 ={A,B,C} and R2={C,D} then
F1={AB, A BC} and F2 ={CD} so F1 F2 is {AB, A BC, C D}.