GATE DA 2024 | Question 26

MCQ · 1 mark · −0.33

Consider a database that includes the following relations:

Defender(name, rating, side, goals)

Forward(name, rating, assists, goals)

Team(name, club, price)

Which ONE of the following relational algebra expressions checks that every name occurring in Team appears in either Defender or Forward, where \(\phi\) denotes the empty set?

  1. Option A: \(\Pi_{\mathit{name}}(\text{Team}) \setminus \big(\Pi_{\mathit{name}}(\text{Defender}) \cap \Pi_{\mathit{name}}(\text{Forward})\big) = \phi\)
  2. Option B: \((\Pi_{\mathit{name}}(\text{Defender}) \cap \Pi_{\mathit{name}}(\text{Forward})) \setminus \Pi_{\mathit{name}}(\text{Team}) = \phi\)
  3. Option C: \(\Pi_{\mathit{name}}(\text{Team}) \setminus \big(\Pi_{\mathit{name}}(\text{Defender}) \cup \Pi_{\mathit{name}}(\text{Forward})\big) = \phi\) (correct)
  4. Option D: \(\big(\Pi_{\mathit{name}}(\text{Defender}) \cup \Pi_{\mathit{name}}(\text{Forward})\big) \setminus \Pi_{\mathit{name}}(\text{Team}) = \phi\)

Answer

(C)

Explanation

The condition says that the set of Team names is contained in the set of names that occur in Defender or Forward:

\[\Pi_{\mathit{name}}(\text{Team}) \subseteq \Pi_{\mathit{name}}(\text{Defender}) \cup \Pi_{\mathit{name}}(\text{Forward}).\]

A set \(A\) is a subset of \(B\) exactly when \(A \setminus B = \phi\): nothing in \(A\) is left over after removing the members of \(B\). That is option C.

  • A uses \(\cap\), so it would demand that every Team name occur in both Defender and Forward.
  • B and D test the opposite inclusion, that the players' names all occur in Team.

Answer: C