The Brief
Welcome to Day 4! It's still John at Maven Analytics here.
You've got CTEs. You've got window functions. Today they work together.
The task: build a complete Q1 business review for Apex Retail, revenue by segment with month-over-month trend, product performance ranked within category, and a returns analysis that shows net revenue after refunds. This is the kind of report that gets presented at a quarterly leadership meeting, and the kind of SQL that goes into a senior analyst portfolio.
The scenario
Sarah's final brief: "Before the leadership presentation, I need three things: the monthly revenue trend by customer segment, the top product in each category by net revenue (after accounting for any returns), and a returns breakdown by reason. Can you pull it all together in one place?"
Three questions. All of them multi-step. All of them answerable with what you've built this week.