Three Moons of Revenue Flow :Track Supplier Revenue Across Three Months with Completed Orders Advanced
Track supplier revenue across three months with completed orders.
Xorthax wants to monitor supplier sales revenue. For each supplier and product, show a rolling total across the current month and the previous two months in which that product had completed orders. Calculate revenue using the quantities and unit prices recorded in OrderDetails and the exchange rate from the Currency table. Return only months with completed orders, ordered by supplier ID, product ID, then month.
Write Your Query
It models how analysts monitor supplier performance by reviewing rolling revenue across months with completed orders.
You’ll practice building rolling calculations with window functions, applying frame clauses, and using partitioning and ordering logic to analyze changing revenue patterns over time.
This problem is labeled as Advanced. It’s intended for learners who are already comfortable with common window functions and want to push into more complex analytical patterns. Don’t rush — work through the hints one at a time and study the final query structure carefully.
Yes. Every problem comes with optional hints you can reveal one at a time, plus a fully worked step-by-step solution. You decide how much help you want while practicing.
All problems on PracticeWindowFunctions.com are completely free and can be solved without creating an account. Right now there are over 80 practice problems, with new ones added regularly.