GATE CS 2018 · SQL Queries

MCQ · 2 marks · Problem DBMS-SQL-0070

Consider the relations r(A, B) and s(B, C), where s.B is a primary key and r.B is a foreign key referencing s.B. Consider the query \(Q:r \Join (\sigma _{B\lt 5}(s))\) Let LOJ denote the natural left outer-join operation. Assume that r and s contain no null values. Which one of the following queries is NOT equivalent to Q?
  1. A
    \(\sigma _{B \lt 5}(r\Join s)\)
  2. B
    \(\sigma _{B\lt 5}(r LOJ s)\)
  3. C
    \(r LOJ(\sigma _{B\lt 5}(s))\)
  4. D
    \(\sigma _{B\lt 5}(r) LOJ s\)

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/204115/gate2018-41

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