Each Country's Share of Revenue

medium
Checkpoint challenge
Solve this to show you know the material and jump straight to Unit 11. Everything before it counts as cleared.

Return country, revenue and pct_of_total: that country's share of all revenue as a percentage, rounded to 1 decimal place. Include only countries with orders, sorted by revenue from highest to lowest.

Try to do it in a single query, without a subquery for the grand total.

Schema

customers(id, name, country, signup_date)
orders(id, customer_id, order_date, total)
#window-functions#aggregation1 visible + 1 hidden tests
query.sql · SQLite
Loading editor…
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Each Country's Share of Revenue · TechGradify