CERTIFIED-DATA-ANALYST-ASSOCIATE · Question #26
CERTIFIED-DATA-ANALYST-ASSOCIATE Question #26: Real Exam Question with Answer & Explanation
The correct answer is C: GROUP BY. GROUP BY is the correct answer because it's the SQL clause that groups rows sharing common values into summary rows, enabling aggregation by product category and month simultaneously - which is exactly what "summarize by" means in SQL terms. Why the distractors are wrong: AVG and
Question
A data analyst has been asked to create a Databricks SQL query that will summarize sales data by product category and month. Which SQL function can you use to accomplish this?
Options
- AAVG
- BSUM
- CGROUP BY
- DORDER BY
Explanation
GROUP BY is the correct answer because it's the SQL clause that groups rows sharing common values into summary rows, enabling aggregation by product category and month simultaneously - which is exactly what "summarize by" means in SQL terms.
Why the distractors are wrong:
- AVG and SUM are aggregate functions that perform calculations within groups, but neither one organizes the data into categories - you need GROUP BY first to define what those groups are.
- ORDER BY simply sorts the result set; it has no effect on how data is grouped or summarized.
Memory tip: Think of GROUP BY as the "organizer" and SUM/AVG as the "calculators." You can't calculate group-level totals without first telling SQL what the groups are - GROUP BY always comes before the aggregation makes sense. When a question says "summarize by X," reach for GROUP BY.
Community Discussion
No community discussion yet for this question.