Marketing wants 2025 spend and 2025 purchases in one table by channel. Spend is recorded per campaign per day and purchases are recorded per conversion, so the two tables do not have the same grain.
Return channel, spend (the sum of spend on daily_spend rows with spend_date in 2025), purchases (the number of conversions with conversion_type purchase and converted_at in 2025, credited to the channel of the lead's campaign), and purchase_revenue (the revenue of those purchases), with spend and purchase_revenue rounded to 2 decimals. Include every channel that appears in campaigns, with 0 where a channel has no spend or no purchases. Order by channel.
Create a free account to save your progress and reveal the worked answer for this free exercise. The complete practice library is available with Practice Pass or Mastery.