Question

Customers(cust_id,name): (1,'A'),(2,'B'),(3,'C'). Orders(order_id,cust_id,amount): (1,1,200),(2,2,150),(3,1,300),(4,3,100). What does the following query return? SELECT
C.name, SUM(O.amount) AS total FROM Customers C LEFT JOIN Orders O ON
C.cust_id = O.cust_id GROUP BY
C.name HAVING SUM(O.amount) > 150;

A ('A', 500) and ('B', 150)
B ('A', 500) only
C All three customers with their respective totals
D ('B', 150) and ('C', 100)
E No rows are returned
Practice Next

Hey! Ask a query

🎓
Think You're Ready for RBI Grade B?
RBI Grade B 2026 Phase 1 Memory Based Paper
  • 200 Questions with Detailed Solutions
  • Section-wise Coverage (GA, English, Quant & Reasoning)