Skip to content
Official PYQ · 2025

GATE CS 2025 Set 1 Q29 — Tuple Calculus and SQL

Explain with AI

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, playername 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′M I^{\prime} ?

Choose one option
View worked solution

Answer: A

To find the names of the players who play for the team named 'MI', we need to formulate a Tuple Relational Calculus (TRC) expression.

Step-by-Step Analysis:

  1. Identify the Target Attribute: We want to retrieve the player names (pname). Since pname belongs to the players relation, our main tuple variable pp must range over players.
    This gives the starting structure: {p.pname∣p∈players∧… }\{ p.pname \mid p \in \text{players} \wedge \dots \} This immediately eliminates options B and D, which incorrectly state p∈teamsp \in \text{teams}.
  2. Join and Selection Conditions: To filter players by their team name, we must link the players relation with the teams relation.
    • We introduce a existential quantifier for a team tuple t∈teamst \in \text{teams}.
    • The join condition is that the team ID of the player must match the team ID of the team: p.tid=t.tidp.tid = t.tid.
    • The selection condition is that the team name must be 'MI': t.tname=′MI′t.tname = 'MI'.
    Combining these, we get the condition: ∃t(t∈teams∧p.tid=t.tid∧t.tname=′MI′)\exists t (t \in \text{teams} \wedge p.tid = t.tid \wedge t.tname = 'MI')

Evaluating the Options:

  • Option A: Correctly specifies p∈playersp \in \text{players} and includes the necessary join condition p.tid=t.tidp.tid = t.tid along with the team name filter.
  • Option C: Missing the join condition p.tid=t.tidp.tid = t.tid. This query would return the names of all players in the database as long as there exists at least one team named 'MI'.

Thus, the correct TRC query is represented by Option A.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Tuple Calculus and SQL questions