GATE DA 2025 Q33: SQL: loans larger than every SR Nagar loan
- Database Management and Warehousing
- 1 mark
- NAT
- No negative marking
Question
On a relation named Loan of a bank:
| loan_number | branch_name | amount |
|---|---|---|
| L11 | Banjara Hills | 90000 |
| L14 | Kondapur | 50000 |
| L15 | SR Nagar | 40000 |
| L22 | SR Nagar | 25000 |
| L23 | Balanagar | 80000 |
| L25 | Kondapur | 70000 |
| L19 | SR Nagar | 65000 |
SELECT L1.loan_number
FROM Loan L1
WHERE L1.amount > (SELECT MAX (L2.amount)
FROM Loan L2
WHERE L2.branch_name = 'SR Nagar');The number of rows returned by the query is ____ (Answer in integer)
Try it: numerical answer: type the value
Numerical answer. No negative marking.
Show answer and explanation
Answer: 3 (official GATE 2025 final answer key)
Concept used: Scalar subquery with an aggregate (MAX) in the WHERE clause.
First step: Evaluate the subquery first: the largest SR Nagar loan amount is 65000. Then count loans with amount strictly greater than that.
Full step-by-step solution
Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.
Share this question
Source: official GATE 2025 DA question paper and final answer key, organised by IIT Roorkee. Question paper · Answer key
More Database Management and Warehousing PYQs
- 2025 · Q16Non-dependency-preserving decomposition: which operator runs more?
- 2025 · Q17Relational algebra on Car, Make and Own
- 2025 · Q46OLAP: rows returned by GROUP BY CUBE(D1, D2)
- 2025 · Q56Keys and NULLs in Person and Customer tables
- 2025 · Q57Candidate keys and BCNF for R(ABCDEFG)
- 2025 · Q62Relational division: customers with loans at every branch