Big Spenders per Country, Including Zeros

medium
Unit 21 · Aggregation & Joins II0/3 to milestone

A big spender has total spend of at least 150. Return every country that has customers, with country and big_spenders (the number of big spenders there, 0 if none). Sort by big_spenders descending, then country.

Schema

customers(id, name, country, signup_date)
orders(id, customer_id, order_date, total)
#joins#aggregation#left-join1 visible + 1 hidden tests
query.sql · SQLite
Loading editor…
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Big Spenders per Country, Including Zeros · TechGradify