GATE CS 2025 Set 1 — Question 55
Go beyond PYQs with Success TrackerAI-powered personalised practice and doubt support. Unlimited practice on eligible plans; AI usage limits apply.NAT+2 / -0EasySubqueriesSQLDatabasesAggregate FunctionsSQL Joins
Databases → SQL → Aggregate Functions
Last updated
Question
Consider the following database tables of a sports league.player(pid,pname,age)
coach(cid,cname)
team(tid,tname,city,cid)
members(pid,tid)An instance of the table and an SQL query are given.player
coach
team
members
The value returned by the given SQL query is ______ . (Answer in integer)
coach(cid,cname)
team(tid,tname,city,cid)
members(pid,tid)An instance of the table and an SQL query are given.player
| pid | pname | age |
|---|---|---|
| 1 | Jasprit | 31 |
| 2 | Atharva | 24 |
| 3 | Ishan | 26 |
| 4 | Axar | 30 |
| cid | cname |
|---|---|
| 101 | Ricky |
| 102 | Mark |
| 103 | Trevor |
| tid | tname | city | cid |
|---|---|---|---|
| 10 | MI | Mumbai | 102 |
| 20 | DC | Delhi | 101 |
| 30 | PK | Mohali | 103 |
| pid | tid |
|---|---|
| 1 | 10 |
| 2 | 30 |
| 3 | 10 |
| 4 | 20 |
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
)
Correct answer
26 to 26
Solution
To find the value returned by the SQL query, we evaluate it step-by-step:
1.Inner Query Evaluation:
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, for
cname = 'Mark', thecidis . - From the team table, for
cid = 102, thetidis . - From the members table, for
tid = 10, thepidvalues are and . - Thus, the inner query returns the set .
SELECT MIN(P.age)
FROM player P
WHERE P.pid IN (1, 3)
- From the player table:
- For
pid = 1, theageis . - For
pid = 3, theageis . - The
MINfunction calculates the minimum of these ages: .
Continue learning with Success Tracker
A step still unclear? Work through it with support
Use Success Tracker to ask about the reasoning, then try another GATE CS question to check your understanding.
AI-powered practice· Unlimited practice on eligible plans
- PYQs with solutions
- Attempt available previous-year questions, then compare your reasoning with the worked solution. Coverage varies by stream.
- Practice that adapts
- Choose a topic, work on weaker areas and bookmark questions to revisit. Your attempts feed your progress tracking.
- AI doubt support
- Ask follow-up questions about a step or concept while practising, instead of stopping at the final answer.
Unlimited practice is available on eligible plans. Free practice and AI usage have limits; check the current plan allowances before choosing.
This page stays readable without an account. AI responses can be wrong; check them against the solution and source material.
More questions on SQL
2026 Set 2 Q15In the context of DBMS, consider the two sets T and S given below. | T | S | |---|---| | I:…2026 Set 2 Q20Consider concurrent execution of two transactions and in a DBMS, both of which access a…2026 Set 1 Q30Let and be the attributes of a relation in a relational schema. Let…2026 Set 1 Q31In the context of relational database normalization, which of the following statements is/are true?2026 Set 2 Q42In the context of schema normalization in relational DBMS, consider a set F of functional…