SpinTheMic
Pro

Interview practice question

Orders by status in one row per day

Data Analyst · SQL for Analytics · Beginner

You need a daily report with columns for total orders, delivered orders and cancelled orders. How do you write it?

What a strong answer covers

Your AI report card counts how many of these ideas you cover.

  • GROUP BY day.
  • COUNT(*) total.
  • SUM(CASE WHEN status='delivered' THEN 1 ELSE 0 END).
  • Or COUNT(*) FILTER (WHERE ...).
  • Add rates as ratios.
Practise this topic

Start without signing up. Sign in free to get an AI report card on your answer.

See all topics