GATE 2025 CS (CS1) – Question 39
Consider two relations describing $teams$ and $players$ in a sports league:
- $teams(tid, tname)$: $tid$, $tname$ are team-id and team-name, respectively
- $players(pid, pname, tid)$: $pid$, $pname$, and $tid$ 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 $tname$ as 'MI'?
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (A) $\{ p.pname \mid p \in players \wedge \exists t (t \in teams \wedge p.tid = t.tid \wedge t.tname = 'MI')\}$
Explanation
The query must range p over players and join with teams on tid with tname='MI'. Only (A) does this. (B) and (D) use the wrong relations, and (C) omits the join condition.