Question 66Asked in UGC NET Computer Science, November 2017 (Paper II & III, Selected Questions)

Given two relations R₁(A, B) and R₂(C, D), the result of following query

Given two relations R₁(A, B) and R₂(C, D), the result of following query Select distinct A, B From R₁, R₂ is guaranteed to be same as R₁ provided one of the following condition is satisfied.
  1. AR₁ has no duplicates and R₂ is empty
  2. BR₁ has no duplicates and R₂ is non - empty
  3. CBoth R₁ and R₂ have no duplicates
  4. DR₂ has no duplicates and R₁ is non - empty
Show answerHide answer

Correct answer: (B) R₁ has no duplicates and R₂ is non - empty

Explanation

The query takes the Cartesian product R₁ × R₂ and projects A, B with duplicates removed. If R₂ is empty the product is empty, so R₂ must be non-empty; and since DISTINCT removes duplicates, the result equals R₁ only if R₁ has no duplicates.

From UGC NET Computer Science PYQ, November 2017 (Paper II & III, Selected Questions)

This is question 66 of UGC NET Computer Science PYQ, November 2017 (Paper II & III, Selected Questions). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.