Use LEFT JOIN to include regions with no sales, and handle NULLs with COALESCE
We're evaluating regional expansion for next year. Can you pull a table of all regions with their total revenue and number of sales? I want ALL regions listed even if they haven't had any sales — those gaps are exactly what I'm looking for. Make sure zeros show as 0, not NULL.
Each hint you reveal reduces the XP you can earn. Try the query first.
Start from dim_regions and LEFT JOIN fact_sales — this keeps all regions even with no matching sales
Use COALESCE(SUM(revenue), 0) so regions with no sales show 0 instead of NULL
GROUP BY region_id and region_name, then ORDER BY total_revenue DESC to surface the biggest opportunities