## Questions on Lossless Join

To Identify whether a decomposition is lossy or lossless, it must satisfy the following conditions :

- R
_{1}∪ R_{2}= R - R
_{1}∩ R_{2}≠ Φ and - R
_{1}∩ R_{2}→ R_{1}or R_{1}∩ R_{2}→ R_{2}

Question 1 : R(ABC) F = {A → B, A → C} decomposed into D = R_{1}(AB), R_{2}(BC) Find whether D is Lossless or Lossy ?

Solution : D = {AB, BC} Step 1: AB ∪ BC = ABC Step 2: AB ∩ BC = B //Intersection Step 3: B^{+}= {B} //Not a super key of R_{1}or R_{2}⇒ Decomposition is lossy.

Question 2 : R(ABCDEF) F = {A → B, B → C, C → D, E → F} decomposed into D = R_{1}(AB), R_{2}(BCD), R_{3}(DEF). Find whether D is Lossless or Lossy ?

Solution : Step 1: AB ∪ BCD ∪ DEF = ABCDEF = R // Condition 1 satisfies step 2: AB ∩ BCD = B B^{+}= {BCD} //superkey of R_{2}⇒ R_{12}(ABCD) ABCD ∩ DEF = D D^{+}= {D} // Not a superkey of R_{12}or R_{3}⇒ Decomposition is Lossy.

Question 3 : R(ABCDEF) F = {A → B, C → DE, AC → F} decomposed into D = R_{1}(BE), R_{2}(ACDEF). Find whether D is Lossless or Lossy ?

Solution : Step 1: BE ∪ ACDEF = ABCDEF = R // Condition 1 satisfies step 2: BE ∩ ACDEF = E E^{+}= {E} //Not a superkey of R_{1}or R_{2}⇒ Decomposition is Lossy.

Question 4 : R(ABCDEG) F = {AB → C, AC → B, AD → E, B → D, BC → A, E → G} decomposed into (i) D1 = R_{1}(AB), R_{2}(BC), R_{3}(ABDE), R_{4}(EG). (ii) D2 = R_{1}(ABC), R_{2}(ACDE), R_{3}(ADG). Find whether D1 and D2 is Lossless or Lossy ?

Solution (i) : Step 1: AB ∪ BC ∪ ABDE ∪ EG = ABCDEG = R // Condition 1 satisfies step 2: AB ∩ BC = B B^{+}= {BD} //Not a superkey of R1 or R_{2}⇒ Decomposition is Lossy. No need to check further. Solution (ii) : Step 1: ABC ∪ ACDE ∪ ADG = ABCDEG = R // Condition 1 satisfies step 2: ABC ∩ ACDE = AC AC^{+}= {ACBDEG} //superkey ⇒ R_{12}(ABCDE) ABCDE ∩ ADG = AD AD^{+}= {ADEG} //Superkey of R_{3 }⇒ R_{123}(ABCDEG) ⇒ Decomposition is LossLess.

Question 5 : R(ABCDEFGHIJ) F = {AB → C, B → F, D → IJ, A → DE, F → GH} decomposed into (i) D1 = R_{1}(ABC), R_{2}(ADE), R_{3}(BF), R_{4}(FGH),R_{5}(DIJ). (ii) D2 = R_{1}(ABCDE), R_{2}(BFGH), R_{3}(DIJ). (iii) D3 = R_{1}(ABCD), R_{2}(DE), R_{3}(BF), R_{4}(FGH),R_{5}(DIJ). Find whether D1, D2 and D3 is Lossless or Lossy ?

Solution (i) : Step 1: ABC ∪ ADE ∪ BF ∪ FGH ∪ DIJ = ABCDEFGHIJ = R // Condition 1 satisfies step 2: ABC ∩ ADE = A A^{+}= {ADEIJ} //Superkey of R_{2 }⇒ R_{12}(ABCDE) ABCDE ∩ BF = B B^{+}= {BFGH} //superkey of R_{3 }⇒ R_{123}(ABCDEF) ABCDEF ∩ FGH = F F^{+}= {FGH} //Superkey of R_{4 }⇒ R_{1234}(ABCDEGH) ABCDEFGH ∩ DIJ = D D^{+}= {DIJ} //Superkey of R_{5 }⇒ R_{12345}(ABCDEGHIJ) ⇒ Decomposition is LossLess. Solution (ii) : Step 1: ABCDE ∪ BFGH ∪ DIJ = R // Condition 1 satisfies step 2: ABCDE ∩ BFGH = B B^{+}= {BFGH} //Superkey of R_{2 }⇒ R_{12}(ABCDEFGH) ABCDEFGH ∩ DIJ = D D^{+}= {DIJ} //superkey of R_{3 }⇒ R_{123}(ABCDEFGHIJ) ⇒ Decomposition is LossLess. Solution (iii) : Step 1: ABCD ∪ DE ∪ BF ∪ FGH ∪ DIJ = ABCDEFGHIJ = R // Condition 1 satisfies step 2: ABCD ∩ DE = D D^{+}= {DIJ} //Not a super key of R_{1}or R_{2 }⇒ Decomposition is Lossy. No need to check further.

### Incoming search terms:

- lossless join
- toughest question lossless decompostion
- lossless sample question
- lossy and non lossy identification
- lossless and lossy decomposition check
- losseless or lossy in dbms example
- how to do decomposition and check for lossy and lossless
- how to check whether a decomposition is lossy or lossless with example
- examples on lossless decomposition
- easy questions on lossy loseless decoposition

In Question 5, D3 is lossy. D+ is neither a superkey of R1 or R2.

Thanks for the correction Aditya 🙂