Loading lesson…
Level 1 · Apprentice0 XP
Rankings, running totals and readable multi-step queries.
Step 1 / 5
ProblemA report query nests five subqueries. Nobody can read it, and computing 'each customer's latest order' needs a self-join that is slow and confusing.
← → step
Before this: SQL queries: select, join and group
🛠️ Your turn
Reading is not the skill, doing is. Try for ten minutes before you open the hint. Getting stuck first is what makes the solution stick.
1.Using window functions, compute each product's rank by revenue within its category, a 7-day moving average of daily revenue, and each customer's days between consecutive orders.