GATE / CS ARCHIVE

GATE CSE 2025 SET 1 / QUESTION 39

Building a relational-calculus join

Database Management Systems · Relational Algebra & Calculus · Full GATE CSE 2025 Set 1 paper

GATE 2025 Set 1, Q39 2 marks · MCQ
Report issue

Relational Algebra & Calculus

Question 39, GATE 2025: Relations are teams(tid,tname) and players(pid,pname,tid). Return names of players on a team named MI. A {p.pname | p∈players ∧ ∃t(t∈teams ∧ p.tid=t.tid ∧ t.tname='MI')}; B the same expression but p∈teams and t∈players; C the expression in A without p.tid=t.tid; D the expression in B without p.tid=t.tid. Which is correct?
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Approach: Translate the desired result into tuple bindings, a join predicate, a selection predicate and a projected attribute.
A returned name must come from a player tuple, so bind p to players. There must exist a team tuple t whose id equals the player’s team id, giving t∈teams and p.tid=t.tid. The selected team must have t.tname='MI'. Project p.pname from precisely those player tuples. These requirements combine exactly as A.
B and D bind p to teams even though teams has no pname attribute, and bind t to players even though players has no tname attribute. They are not correctly typed for the supplied schemas.
C has the right bindings but omits the join. If any team is called MI, its existential condition becomes true for every player, including players on other teams. That illustrates why a selection on team name does not replace the relationship connecting a player to that team.

Original paper, page 39 · Answer key