Question:

On a relation named Loan of a bank: 

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: Apr 4, 2025
Hide Solution
collegedunia
Verified By Collegedunia

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

Questions Asked in GATE DA exam

View More Questions