6,561 views
1 votes
1 votes

Consider a relation R= {M, N, O,P, Q, R, S, T} with the following set of dependencies:
MN--> Q
M--> RQ
N--> R
R--> ST
Next consider the following set of decompositions for the relation schema R:
D1= {R1,R2,R3,R4}: R1={M,N,O,P}, R2={M,P,Q}, R3= {N,R}, R4={R,S,T}
D2= {R1,R2,R3,R4}: R1={M,N,O}, R2= {P,Q}, R3= {N,R}, R4= {R,S,T}
Which of the above decomposition (s) has/ have lossless join property?
A. Only D1

B. Only D2

C. Both D1 and D2

D. Neither D1 nor D2

3 Answers

Best answer
5 votes
5 votes

A = {R3= {N,R} JOIN R4={R,S,T} },   R is key of R4
B = A JOIN R1={M,N,O,P}, N is Key of A
B JOIN R2={M,P,Q} , MP is key of R2
So LOSSLESS..



D2= {R1,R2,R3,R4}: R1={M,N,O}, R2= {P,Q}, R3= {N,R}, R4= {R,S,T}
NOT LOSSLESS

 

selected by
2 votes
2 votes
for D1 : R1(MNOP), and R2(MPQ) common attribute is MP , now MP+=MPRQST so MP is key for R2 now R1 join R2 gives MNOPQ which is joined with R3(NR) now common attribute between them is N , then N+=NR so N is the key for ne of the table again we join MNOPQ with R3(NR) gives MNOPQR now i tis joined with R4(RST) wher common attribute is R so closure of R+=RST so r is the key for one of the table so each common attribute for each table satisfy the the property of lossless join so D1 is the losless join

now for D2:N is the common in R1 & R3 now N+=NR so n is key for R3 , now again union of R3 &R1 gives MNOR intersection R4 gives R , closure R is R+=RST so r is the key for R4 , now union of MNOR & R4 is MNORST ,

intersection of MNORST nad R2 is = $\phi$ so this is lossy

Related questions

3 votes
3 votes
4 answers
1