Skip to content
GATEiit

GATE DA 2025 Q33: SQL: loans larger than every SR Nagar loan

Question

On a relation named Loan of a bank:

loan_numberbranch_nameamount
L11Banjara Hills90000
L14Kondapur50000
L15SR Nagar40000
L22SR Nagar25000
L23Balanagar80000
L25Kondapur70000
L19SR Nagar65000
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

WhatsAppDownload image

Source: official GATE 2025 DA question paper and final answer key, organised by IIT Roorkee. Question paper · Answer key