Exam Certified Data Analyst Associate All QuestionsBrowse all questions from this exam
Question 27

A data analyst has been asked to count the number of customers in each region and has written the following query:

If there is a mistake in the query, which of the following describes the mistake?

    Correct Answer: B

    The mistake in the query is that it is missing a GROUP BY region clause. When using an aggregate function like COUNT(*) along with non-aggregated columns such as region, the query needs a GROUP BY clause to specify how the data should be grouped for the aggregation. Without the GROUP BY clause, the query will not execute properly as SQL requires it to perform the aggregation correctly.

Discussion
MrWood47Option: B

The mistake in the query is that it is missing a GROUP BY clause. When using an aggregate function like COUNT(*) in conjunction with non-aggregated columns like region, you need to include a GROUP BY clause to specify how the data should be grouped for the aggregation.