GATE CS 2004 · SQL Queries

MCQ · 1 mark · Problem DBMS-SQL-0146

Let R1(\(\underline{A}\),B,(C)) and R2(\(\underline{D}\),E) be two relation schema, where the primary keys are shown underlined, and let C be a foreign key in R1 referring to R2 . Suppose there is no violation of the above referential integrity constraint in the corresponding relation instances r1 and r2 . Which one of the following relational algebra expressions would necessarily produce an empty relation?
  1. A
    \(\Pi _{D}(r2)-\Pi _{C}(r1)\)
  2. B
    \(\Pi _{C}(r1)-\Pi _{D}(r2)\)
  3. C
    \(\Pi _{D}(r1\Join _{C\neq D}r2 )\)
  4. D
    \(\Pi _{C}(r1\Join _{C=D}r2 )\)

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

Show the worked solutionOfficial GATE Answer Key: Option B.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/1010/gate2004-13

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