Why would this query fail? SELECT campaign, SUM(impressions) AS impressions FROM dsp_impressions
Choose an answer
Tap an option to check your answer.
Correct answer: There is no GROUP BY statement; this query cannot be run without aggregation on the campaign dimension..
Why this is the answer
The correct answer is There is no GROUP BY statement; this query cannot be run without aggregation on the campaign dimension because the query is attempting to perform an aggregation (SUM) on the impressions field while selecting the campaign field, but it does not include a GROUP BY clause to specify how the data should be grouped. In SQL, when using an aggregate function like SUM, all non-aggregated fields in the SELECT statement (such as campaign) must be included in a GROUP BY clause. Without this, the query cannot properly aggregate the impressions for each campaign, leading to a syntax error. The other options are not correct because a WHERE clause is not required for every query, and SELECT statements can indeed be used to choose metrics from a table.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed