Aggregation & GROUP BY SQL interview questions

Almost every analytics interview starts here: grouping rows, choosing the right grain and filtering on aggregates with HAVING. These problems also test ratio-of-sums versus average-of-ratios and NULL handling.