Place each clause or expression in its logical stage. Source rows Row filters Group rows Group filters Output and sort FROM orders o JOIN customers c ON c.id = o.customer_id WHERE o.ordered_at >= DATE '2026-06-01' AND o.status = 'paid' GROUP BY c.segment HAVING SUM(o.amount) > 10000 SELECT c.segment, SUM(o.amount) AS revenue ORDER BY revenue DESC
Read the full lesson
Sign up free: one personalized lesson every day, matched to your role and goals.
Already have an account? Sign in