Open In App
Related Articles

UGC-NET | UGC-NET CS 2017 Nov – III | Question 11

Improve Article
Save Article
Like Article

Given two relations R1(A, B) and R2(C, D), the result of following query

Select distinct A, B
from R1, R2

is guaranteed to be same as R1 provided one of the following condition is satisfied.
(A) R1 has no duplicates and R2 is empty.
(B) R1 has no duplicates and R2 is non – empty.
(C) Both R1 and R2 have no duplicates.
(D) R2 has no duplicates and R1 is non – empty.

Answer: (B)

Explanation: Select A,B
From R1, R2 :
In this query first we will take cartesian product of R1, R2 (R2 must be non empty)for this 0- R2 then select distinct A,B from cartesian product of R1, R2 (for A,B being distinct there should not any duplicate A,B).
Select A,B
From R2
For this query A,B → No duplicate A,B.
By combining condition for both query we will get the right condition.
So, option (B) is correct.

Quiz of this Question

Last Updated : 19 Mar, 2018
Like Article
Save Article
Similar Reads