JOIN campaigns with purchases and find top revenue campaign
Can you break down campaign performance for me? I need `campaign_name`, total sends, total opens, and total purchases attributed to each campaign. Sort by purchases descending — I want to see which ones actually drove revenue.
Each hint you reveal reduces the XP you can earn. Try the query first.
JOIN `fact_purchases` to `dim_campaigns` on `campaign_id` to link purchases to campaigns
Filter refunds with `WHERE p.amount > 0`, then `GROUP BY c.campaign_id, c.campaign_name` and `SUM(p.amount) AS total_revenue`
Use `ORDER BY total_revenue DESC LIMIT 1` to get the single top campaign