# SQL Starter Cheatsheet ## The analyst flow 1. Start with the business question. 2. Select only the columns you need. 3. Filter before you aggregate. 4. Name every metric and validate the grain. ```sql SELECT product_category, SUM(revenue) AS revenue FROM orders WHERE order_date >= '2026-01-01' GROUP BY product_category ORDER BY revenue DESC; ``` Remember: `WHERE` filters rows before grouping; `HAVING` filters groups after aggregation.