CodeMIRAI
0 XP

Customers per country

Medium +50 XP Solved

For each country, return the country and the number of customers there. Sort by the count from highest to lowest, then by country name alphabetically.

Input
(none)
Expected output
India | 3
France | 1
Germany | 1
Italy | 1
Japan | 1
Spain | 1
UK | 1
USA | 1
Show a hint

GROUP BY country makes one row per country; COUNT(*) counts the rows in each group.

Show a solution
SQL
Loading the editor…
Run the tests to check your solution.