Largest Order in Each Country

medium
Unit 14 · Window Functions VII0/3 to milestone

For each country that has orders, return country, the order_id and total of its largest order. If two orders tie, return the one with the lower order id. Sort by country.

Schema

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