A data analyst queries a table of daily transactions for multiple product lines. The manager wants a figure that combines daily revenue amounts by product line. Which aggregator function should the analyst use to produce that figure?
Adding the revenue amounts for each product line is done with a function that sums numeric values. SUM() adds the daily amounts into a single value. AGGREGATE() is not a function in SQL. COUNT() returns how many rows are in the result set. AVG() computes an average of the daily values. To get a combined number that includes revenue amounts, SUM() is best.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the SUM() function in SQL and how does it work?
Open an interactive chat with Bash
What are other common SQL aggregate functions besides SUM()?
Open an interactive chat with Bash
How does the GROUP BY clause work with SUM() in SQL?