Hard1 markMultiple Choice
Area I: Information SystemsData ManagementSQLArea I

CPA · Question 26 · Area I: Information Systems

Review the following SQL query:<br/>SELECT CustomerID, SUM(OrderAmount)<br/>FROM Orders<br/>GROUP BY CustomerID<br/>HAVING SUM(OrderAmount) > 10000;<br/><br/>What is the purpose of this query?

Answer options:

A.

To list all individual orders greater than 10,000.

B.

To identify customers whose total order value exceeds 10,000.

C.

To count the number of orders per customer.

D.

To delete orders greater than 10,000.

How to approach this question

Analyze the aggregate function (SUM) and the filter (HAVING).

Full Answer

B.To identify customers whose total order value exceeds 10,000.✓ Correct
To identify customers whose total order value exceeds 10,000.
The query groups orders by CustomerID, calculates the total (SUM) for each, and then the HAVING clause filters to show only those totals > 10,000.

Common mistakes

Confusing WHERE (filters rows before grouping) with HAVING (filters groups after aggregation).

Practice the full CPA ISC Practice Exam 5

82 questions · hints · full answers · grading

More questions from this exam