In: Computer Science
What do you mean by Lossless-Join Decomposition, give an example of Lossless-Join decomposition of R = (A, B, C) in R1= (A, B) and R2 = (B, C) by drawing tables?
NO HANDWRITING PLEASE
Lossless Join Decomposition:
The decomposition of a table or relation in DBMS is done to normalize the date if the table or relation is not following the rule of a normal form. We decompose the table into two or more tables if it preserves the dependency and lossless join.
By using a lossless join decomposition method we remove the redundancy from the database and the original data is preserved as it is.
If we can reconstruct a table from the decomposed tables using joins and join results in the same original table, then decomposition is lossless otherwise decomposition is lossy.
We can use three methods, to check the decomposition is lossless or lossy:
1. Matrix method
2. Binary method
3. Join method
R = (A, B, C) is decomposed into
R1= (A, B) and
R2 = (B, C)
R(A, B, C)
A | B | C |
10 | 25 | 10 |
20 | 50 | 60 |
30 | 30 | 60 |
R1(A, B)
A | B |
10 | 25 |
20 | 50 |
30 | 30 |
R2(B, C)
B | C |
25 | 10 |
50 | 60 |
30 | 60 |
Now perform the natural join on subtable R1 and R2:
R(A, B, C)
A | B | C |
10 | 25 | 10 |
20 | 50 | 60 |
30 | 30 | 60 |
This table is the same as the original table.
So, this is lossless join decomposition.