The GATE Grind

GATE 2012 CS (CS1) – Question 53

Databases · Integrity Constraints and Normal Forms · 2 marks · Multiple choice

R₁(A,B) and R₂(C,D) have instances r₁,r₂. B references C as a foreign key and referential integrity holds. Which always holds?

  1. $\pi_B(r_1)-\pi_C(r_2)=\varnothing$
  2. $\pi_C(r_2)-\pi_B(r_1)=\varnothing$
  3. $\pi_B(r_1)=\pi_C(r_2)$
  4. $\pi_B(r_1)-\pi_C(r_2)\ne\varnothing$

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (A) $\pi_B(r_1)-\pi_C(r_2)=\varnothing$

Explanation

Under the relational-set model assumed here, every referenced B value must occur in R₂.C. Therefore πB(r₁) is a subset of πC(r₂), so their difference is empty, A. Referenced rows need not all be used, so neither reverse inclusion nor equality is required.

More Integrity Constraints and Normal Forms questions

All Integrity Constraints and Normal Forms questions →