Customer Revenue Share :Calculate Each Order's Percent of Customer Revenue Intermediate
Measure each order's share of a customer's total spending.
Xorthax wants to understand how much each order contributes to a customer's total spending at his trading post on Zlacksys 19. For each order, show the order amount and calculate that order's percent of the customer's total revenue. Round the answer to 2 decimal places and order by cusotmerID, percent of revenue descending and order id
Write Your Query
This mirrors customer-level revenue contribution analysis, where a business measures how much each order contributes to a customer's total spending.
You’ll practice comparing individual rows to group-level totals, calculating percentage contributions within each customer’s activity, and preserving row-level detail while adding customer-specific context.
This problem is labeled as Intermediate. It assumes you’ve written a few window function queries before, but you don’t need to be an expert. Use the hints and explanations if you get stuck — they’re there to help you think through the logic.
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.