Home » Database » Database miscellaneous » Question

Database miscellaneous

  1. Let R and S be two relations with the following schemas.
    R(P. Q, R1, R2, R3)
    S (P. Q, S1, S2)
    Where {P, Q}is the key for both schemas. Which of the following queries are equivalent?
    1. Πp (R ⋈ S)
    2. Πp (R) ⋈ Πp (S)
    3. Πp ( ΠP , Q (R) ∩ ΠP , Q (S) )
    4. Πp ( ΠP , Q (R) ⋈ ΠP , Q (R) - ΠP , Q (S) ) )
    1. 1 and 2
    2. 1 and 3
    3. 1, 2 and 3
    4. 1, 3 and 4
Correct Option: D

In I, Ps from natural join of R and S are selected. In III, all Ps from intersection of (P, Q) pairs present in R and S. IV is also equivalent to III because (R – (R – S)) = R I S. II is not equivalent as it may also include Ps where Qs are not same in R and S.



Your comments will be displayed only after manual approval.