This question evaluates data manipulation competency in SQL/Python, specifically testing aggregation, ranking, deterministic tie-breaking, and percentage calculations across grouped data to identify top countries by population per continent.
world_population
continent
VARCHAR
country
VARCHAR
population
BIGINT
Assume each row is a country’s latest population and (continent, country) is unique.
continent
,
country
,
population
.
continent
,
country
,
population
, plus a
rank_in_continent
(1 = largest).
continent
,
country
,
population
,
continent_population
,
population_share_pct
.
population_share_pct = 100 * population / continent_population
(round to 2 decimals).
country
ascending to make results deterministic.