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
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;
More SQL Questions
- Materialized views differ from normal views because:
- Which SQL aggregate function returns the number of rows in a column that contain a non-NULL value, ignoring NULL entries in that column?
- Which SQL constraint ensures a column cannot have NULL values?
- Which SQL command permanently removes both the stored data and the entire structural definition (columns, constraints, indexes) of a table from the databas...
- Which SQL keyword is used to remove duplicate records from a query result?
- Which operator is used for pattern matching in SQL?
- A table has salaries 90000, 90000, 85000, 80000 (sorted descending). Using RANK() OVER (ORDER BY Salary DESC), what ranks are assigned, and how does this d...
- Given a table employees(id, dept_id, salary), which query returns departments with average salary greater than overall average across the company?
- Table Employee(EmpID, ManagerID) has 6 rows: (1,NULL), (2,1), (3,1), (4,2), (5,2), (6,3). How many rows will the following self-join return? SELECT E.EmpI...
- What is a 'stored procedure' in SQL?
Hey! Ask a query
Please enter email id
The email must be a valid email address.
Please enter Mobile Number
Please enter valid Mobile Number
Please enter your Doubt
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)