GateAI
SQL

GATE CSE 2025 Set 1 · Q55

NAT2 marksEasy

Time

Consider the following database tables of a sports league. player(pid, pname, age)team(tid, tname, city, cid)coach(cid, cname)members(pid, tid) An instance of the table and an SQL query are given.SELECT MIN(P.age) FROM player P WHERE P.pid IN ( SELECT M.pid FROM team T, coach C, members M WHERE C.cname = 'Mark' AND T.cid = C.cid AND M.tid = T.tid )The value returned by the given SQL query is _____ . (Answer in integer)

GATE CSE 2025 Set 1 Q55 diagram

Your answerNumerical answer

Enter a value to check

Solution

Step-by-step verified solution

Official answer: 26

SQL

To determine the value returned by the SQL query, we evaluate it step by step:

  1. Subquery Execution: ```sql SELECT M.pid FROM team T, coach C, members M WHERE C.cname = 'Mark' AND T.cid = C.cid AND M.tid = T.tid ```

    • From the coach table, locate the coach with cname = 'Mark'. The corresponding cid is 102.

    • From the team table, join on T.cid = C.cid = 102. The team with cid = 102 is tid = 10 (MI).

    • From the members table, join on M.tid = T.tid = 10. The matching rows are:

      • (pid = 1, tid = 10)

      • (pid = 3, tid = 10)

    • Thus, the subquery returns the set of player IDs: {1,3}\{1, 3\}.

  2. Outer Query Execution: ```sqlSELECT MIN(P.age)FROM player P WHERE P.pid IN (1, 3) ```

    • From the player table:

      • For pid = 1 (Jasprit), age = 31.

      • For pid = 3 (Ishan), age = 26.

    • The minimum age among these players is min⁡(31,26)=26\min(31, 26) = 26.

Therefore, the query returns 26.

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This SQL previous year question is Q55 of the GATE CSE 2025 Set 1 paper. Find more GATE CSE PYQs on SQL in Databases, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related SQL PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

SQL in GATE CSE

SQL has 17 GATE CSE PYQs across 14 papers from 2011 to 2025. 5 of them are 2-mark NAT questions like this one, and it is the only one in GATE CSE 2025 Set 1.

How GATE tests SQL

More from GATE CSE 2025 Set 1

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2025 Set 1 · Q55 · NAT

Consider the following database tables of a sports league. player(pid, pname, age) team(tid, tname, city, cid) coach(cid, cname) members(pid, tid) An instance of the table and an SQL query are given. SELECT MIN(P.age) FROM player P WHERE P.pid IN ( SELECT M.pid FROM team T, coach C, members M WHERE C.cname = 'Mark' AND T.cid = C.cid AND M.tid = T.tid ) The value returned by the given SQL query is … (Answer in integer)

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.