IAE Academy

GATE 2024 DA Q.26: solution and answer

GATE 2024 · DAQ.26 · 1 mark · MCQ

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 denotes the empty set?

  1. (A)

  2. (B)

  3. (C)

  4. (D)

See the question in the paper

Answer and solution

ANSWER

The correct option is (C): .

Official answer: CSource: Official answer key, GATE 2024 DA (IISc Bengaluru)

  1. The condition is a subset test: every name in must belong to .

  2. In relational algebra, holds exactly when , because the difference keeps only the tuples of that are absent from .

  3. "Appears in either Defender or Forward" means membership in at least one of the two relations. That is membership in the union, so .

  4. The test is therefore , which is option (C).

  5. Option (A) subtracts the intersection. It is empty only when every Team name is in both Defender and Forward, which is stricter than required. For example, a Team name present only in Defender leaves a non-empty result, although the condition holds.

  6. Options (B) and (D) put Team on the right of the difference. They test whether every name in Defender and Forward (the intersection in (B), the union in (D)) appears in Team. That is the reverse direction and says nothing about the Team names.

KEY IDEA

is checked as , with the relation that must be contained on the left. "Either ... or" means the union.

WATCH OUT FOR

Using the intersection for "either or" (option A), which demands membership in both relations. Or reversing the difference (options B and D), which tests whether Defender/Forward names are in Team.

From the GATE 2024 DA paper. Every question of this paper · Download the full paper · All 5 Relational algebra questions, with notes

More Relational algebra questions