Is my answer correct because here i am not sure if the decomposition lossy or lo
ID: 3712265 • Letter: I
Question
Is my answer correct because here i am not sure if the decomposition lossy or lossless
the question: Consider R(A,B,C,D,E) with {BC->A, D->AE, B->C}
It is decomposed into R1(C,D), R2(B,D) and R3(A,D,E).
Is the decomposition lossy? You must use the chase matrix algorithm (EN Algorithm 16.3) to show your reasoning.
The decompoistion of R into R'(A,B,D,E) and R1(C,D) is lossless since the common attribute is D and D->AE , which is a key in R1. The decompoistion of R' into R2(B,D) and R3(A,D,E) is lossless since the common attribute is D and D->AE in R3. Thus, the overall decomposition is lossless.
Using the chase matrix algorithm:
We use the canonical form: {BC->A, D->AE, B->C}
Step 1. Create a table of 5 columns (number of columns and 4 rows (number of relations). Populate it with b(i,j).
Relation
A
B
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
A
B
C
D
E
R1
b(1,1)
b(1,2)
a(3)
a(4)
b(1,5)
R2
b(2,1)
a(2)
b(2,3)
a(4)
b(2,5)
R3
a(1)
b(3,2)
b(3,3)
a(4)
a(5)
Step 3. While changes can be made with a FD X-> Y, with two rows in the table having the common X values in the following manner:
for every attribute W in Y:
If one cell is an a and the other cell is an b, change the b to the a.
If both cells are b's, change them to the same b.
Applying BC->A: no change.
Applying D->AE:
Relation
A
B
C
D
E
R1
b(1,1)
b(1,2)
a(3)
a(4)
b(1,5)
R2
b(1,1)
a(2)
b(2,3)
a(4)
b(1,5)
R3
a(1)
b(3,2)
b(3,3)
a(4)
a(5)
Applying B->C: no change.
Applying BC->A: no change.
Applying D->AE:
Relation
A
B
C
D
E
R1
a(1)
b(1,2)
a(3)
a(4)
a(5)
R2
a(1)
a(2)
b(2,3)
a(4)
a(5)
R3
a(1)
b(3,2)
b(3,3)
a(4)
a(5)
Relation
A
B
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)
Explanation / Answer
You are correct.
priciple of lossy and lossless say that common attribute is key of any relation then it is called lossless and D is common attribute and it is key R3so it is lossless and your matrix algo also seen right.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.