GATE CS 2014 · Set-2 · SQL Queries

MCQ · 2 marks · Problem DBMS-SQL-0096

SQL allows duplicate tuples in relations, and correspondingly defines the multiplicity of tuples in the result of joins. Which one of the following queries always gives the same answer as the nested query shown below: Select * from R where a in (select S. a from S)
  1. A
    Select R. * from R, S where R. a=S. a
  2. B
    Select distinct R. * from R,S where R. a=S. a
  3. C
    Select R. * from R, (select distinct a from S) as S1 where R. a=S1.a
  4. D
    Select R. * from R, S where R.a = S. a and is unique R

Solve it on GATE DA practice →More Relational Model & SQL problems

Show the worked solutionOfficial GATE Answer Key: Option C.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/2021/gate2014-2-54

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com