Created
November 15, 2023 06:20
-
-
Save phainamikaze/723247781fc1551af6445dccca13a364 to your computer and use it in GitHub Desktop.
Write a query to rank the countries in each region by their population from largest to smallest.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT Region, Name, Population, RANK() over(partition by region ORDER BY population desc) as 'Ranked' FROM world.country ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment