IAE Academy

GATE 2025 CS1 Q.39: solution and answer

GATE 2025 · CS1Q.39 · 2 marks · MCQ

Consider two relations describing teams and players in a sports league:

  • : , are team-id and team-name, respectively
  • : , , and denote player-id, player-name and the team-id of the player, respectively

Which ONE of the following tuple relational calculus queries returns the name of the players who play for the team having as 'MI'?

  1. (A)

  2. (B)

  3. (C)

  4. (D)

See the question in the paper

Answer and solution

ANSWER

The correct option is (A).

Official answer: ASource: Official answer key, GATE 2025 CS1 (IIT Roorkee)

  1. We need the names of players whose team is 'MI'. This needs a join of and on , followed by a selection on .

  2. The output is , and is an attribute only of . So must range over , that is . This rules out (B) and (D), where and is undefined.

  3. Between (A) and (C): in both, the existential variable ranges over , but only (A) has the join condition .

  4. (C) has no join condition. If any team named 'MI' exists, it returns every player in the league, whatever team the player is on.

  5. (A) gives , which is exactly the required query. The answer is (A).

KEY IDEA

In tuple relational calculus, the free tuple variable must range over the relation that holds the output attribute. The link between relations must be written as an explicit join condition on the shared key, here . The selection condition goes in the same existential clause.

WATCH OUT FOR

Choosing (C). It looks right because it ranges over and checks that a team named 'MI' exists. It never ties to that team, so it returns every player whenever any team is named 'MI'.

From the GATE 2025 CS1 paper. Every question of this paper · Download the full paper · All 13 Relational algebra questions, with notes

More Relational algebra questions