Question:

On a relation named Loan of a bank: 

The following SQL query is executed:
SELECT L1.loannumber FROM Loan L1 WHERE L1.amount \(>\) (SELECT MAX(L2.amount) FROM Loan L2 WHERE L2.branchname = 'SR Nagar');

Show Hint

When working with SQL queries that involve subqueries, make sure to carefully analyze the subquery to understand what data it is filtering before considering the main query. In this case, the subquery is used to get the maximum loan amount from a specific branch, and the main query filters based on that maximum value.
Updated On: Jan 30, 2026
Hide Solution
collegedunia
Verified By Collegedunia

Correct Answer: 3

Solution and Explanation

The subquery retrieves the maximum loan amount from the "SR Nagar" branch. The amounts for "SR Nagar" are 40000, 25000, and 65000, so the maximum amount is 65000. The main query selects the loan numbers where the loan amount is greater than 65000. From the given data, the loans with amounts greater than 65000 are:
L11: 90000 (Banjara Hills)
L23: 80000 (Balanagar)
L25: 70000 (Kondapur)
Thus, the number of rows returned by the query is 3. Correct Answer: 3
Was this answer helpful?
0
0

Top Questions on SQL

View More Questions

Questions Asked in GATE DA exam

View More Questions