Consider a relation R(P,Q,R,S,T) with the following functional dependencies:…

Consider a relation R(P,Q,R,S,T) with the following functional dependencies:
FD: {P→QT, RS→Q, T→S, S→P}
Which of the following is true for decomposition of R into R1:(P,Q,S),R2:(R,S,T) :

Answer: A. lossless and dependency preserving🔹 To determine if the decomposition of R(P,Q,R,S,T) into R1(P,Q,S) and R2(R,S,T) is Lossless and/or Dependency Preserving, we must evaluate both properties…

  1. A.

    lossless and dependency preserving

  2. B.

    not lossless but dependency preserving

  3. C.

    lossless but not dependency preserving

  4. D.

    none of the above

Attempted by 103 students.

Show answer & explanation

Correct answer: A

🔹 To determine if the decomposition of R(P,Q,R,S,T) into R1(P,Q,S) and R2(R,S,T) is Lossless and/or Dependency Preserving, we must evaluate both properties systematically.

1. Lossless Join Property Test

A decomposition of R into R1 and R2 is lossless if and only if the intersection of their attributes functionally determines all attributes of at least one of the relations:

$$(R_1 \cap R_2) \rightarrow R_1 \quad \text{or} \quad (R_1 \cap R_2) \rightarrow R_2$$

  1. Find the intersection:

    $$R_1 \cap R_2 = \{P, Q, S\} \cap \{R, S, T\} = \{S\}$$

  2. Compute the attribute closure of the intersection under the original FDs (S+):

    • Start with S+ = {S}

    • Using S -> P, we get S+ = {P, S}

    • Using P -> QT, we get S+ = {P, Q, S, T}

    • Using T -> S (no new attributes)

    • Result: S+ = {P, Q, S, T}

  3. Check containment:

    • Is R1 S+? {P, Q, S} {P, Q, S, T} -> Yes!

    • Is R2 S+? {R, S, T} {P, Q, S, T} (Missing R)

Since (R1 R2) -> R1, the decomposition is Lossless.

2. Dependency Preservation Test

A decomposition is dependency preserving if the union of the closures of FDs projected onto each individual relation contains all original FDs: (F1 F2)+ = F+.

Let's find the projected functional dependencies for R1 and R2:

FDs for R1(P,Q,S):

Compute closures using original FDs to find valid dependencies restricted only to {P, Q, S}:

  • P+ = {P, Q, S, T} {P, Q, S} = {P, Q, S} => {P -> QS}

  • S+ = {P, Q, S, T} {P, Q, S} = {P, Q, S} => {S -> PQ}

  • Q+ = {Q}

FDs for R2(R,S,T):

Compute closures restricted only to {R, S, T}:

  • T+ = {T, S} {R, S, T} = {S, T} => {T-> S}

  • S+ = {P, Q, S, T}{R, S, T} = {S, T} => {S -> T}

  • (RS)+ = {P, Q, R, S, T} {R, S, T} = {R, S, T} => {RS -> T}

Check original FDs against (F1 F2):

  • T -> S: Preserved directly in F2.

  • S -> P: Preserved directly in F1.

  • P -> QT: P -> Q is in F1. To see if P -> T is preserved, compute P+ under (F1 F2):

    $$P^+ = \{P\} \xrightarrow{P \rightarrow QS} \{P, Q, S\} \xrightarrow{S \rightarrow T} \{P, Q, S, T\}$$

    Since T is in the closure, P -> QT is preserved.

  • RS -> Q: Compute (RS)+ under (F1 F2):

    $$({RS})^+ = \{R, S\} \xrightarrow{S \rightarrow PQ} \{P, Q, R, S\}$$

    Since Q is in the closure, RS -> Q is preserved.

All original functional dependencies are preserved, so the decomposition is Dependency Preserving.

Conclusion

The decomposition is both Lossless and Dependency Preserving.

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…