All jobs / Data analyst / BI / SQL

Data analyst / BI interview question · 0–1 years

SELECT customer_id, SUM(amount) without GROUP BY — what is wrong?

The strongest answer

The grain is mixed — an aggregate next to a raw key is either an error or a hidden window; I group or I window on purpose

Why it works

Exactly. Aggregates need a grain. Old engines that guessed a group are not a standard.

What a good answer covers

Answers that fall short

Who gets asked this

More SQL questions