Computer Sciences > GATE 2025 SET-1 > SQL
Consider the following database tables of a sports league.
An instance of the table and an SQL query are given.
The value returned by the given SQL query is ______ (Answer in integer)


Correct : 26
The value returned by the SQL query is 26.
The database has four tables - player(pid, pname, age), team(tid, tname, city, cid), coach(cid, cname), and members(pid, tid). The members table links players to their respective teams, and the cid in the team table links each team to its coach.
The SQL query joins these tables and applies an aggregate function (SUM) along with a subquery to filter or compute values based on the given instance of the tables.
Tracing the query step by step on the provided table instance - applying the join conditions, filtering rows based on the subquery result, and summing the relevant values - gives a final result of 26.
Similar Questions
Select operation in SQL is equivalent to
Consider the following relations:
Consider the following SQL query. SELECT S.Student_Name, sum(P.Marks) FROM Student S, Performance P WHERE S.Roll_No = P...
Given the following schema: employees(emp-id, first-name, last-name, hire-date, dept-id, salary) departments(dept-id, dept-name, manager-id, location-id) You...
Total Unique Visitors
Loading......