To get the total quantity sold by each employee, you need:
An aggregate function to compute the total per group.
A clause to define the grouping (i.e., “by each employee”).
The SQL pattern is generally:
SELECT employee_id,
SUM(quantity) AS total_quantity
FROM sales
GROUP BY employee_id;
SUM (F) is the aggregate function that adds up all quantity values.
GROUP BY (D) groups the rows by employee so that SUM is calculated per employee.
Why the other options are incorrect:
MAX (A) returns the maximum value, not the total quantity.
SELECT (B) is a SQL keyword for selecting columns, not an aggregate function.
HAVING (C) is used to filter groups after aggregation, not to perform aggregation itself.
ORDER BY (E) sorts the result set; it does not calculate totals.
Thus, the functions needed to retrieve the total quantity sold by each employee are GROUP BY (D) and SUM (F).
CompTIA Data+ Reference (concept alignment):
DA0-001 Exam Objectives – Data manipulation: aggregate functions and GROUP BY.
CompTIA Data+ SQL sections: examples combining SUM with GROUP BY to summarize data by category (e.g., employee, product, region).
Submit