Interview questions
Predict the result, find the errors, explain the solution. You can read the questions without an account.
14 questions
What does
WHEREfilter, and what doesHAVINGfilter?Predict the resultCan you add up unique user counts across groups?
Predict the resultWhat proportion of paid orders does
SUM(…) / COUNT(*)calculate?Predict the resultFind the bugs: units ordered and average unit price
Find the errorsWhat happens when you cap each order versus the group total?
Predict the resultHow many rows does
HAVINGreturn withoutGROUP BY?Predict the resultHow many groups and orders does the outer query count?
Predict the resultFind the bugs: revenue from repeat customers
Find the errorsFind the bugs: departments with payroll above the threshold
Find the errors