StreakPeaked· Practice

ExamsGATETechnical

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'?

  1. { p.pname | p ∈ players ∧ ∃t (t ∈ teams ∧ p.tid = t.tid ∧ t.tname = 'MI') }
  2. { p.pname | p ∈ teams ∧ ∃t (t ∈ players ∧ p.tid = t.tid ∧ t.tname = 'MI') }
  3. { p.pname | p ∈ players ∧ ∃t (t ∈ teams ∧ t.tname = 'MI') }
  4. { p.pname | p ∈ teams ∧ ∃t (t ∈ players ∧ t.tname = 'MI') }

Correct answer: { p.pname | p ∈ players ∧ ∃t (t ∈ teams ∧ p.tid = t.tid ∧ t.tname = 'MI') }

Solution

This option correctly identifies players from the 'players' relation and checks for the existence of a corresponding team in the 'teams' relation that matches the specified team name 'MI', ensuring that only players from that team are selected.

Related GATE Technical questions

⚔️ Practice GATE Technical free + battle 1v1 →