Skip to content

Instantly share code, notes, and snippets.

@MrN00b0t
MrN00b0t / worldpop2.sqlite
Last active May 1, 2020 10:23
Codecademy: World Populations II Challenge Project (SQL)
SELECT COUNT(*) AS 'No. Of Countries Sampled in Africa'
FROM countries
WHERE continent = 'Africa';
SELECT ROUND(SUM(population), 2) AS 'Population of Oceania in 2005 (mil)'
FROM countries
JOIN population_years
ON countries.id = population_years.country_id
WHERE countries.continent = 'Oceania' AND population_years.year = 2005;
SELECT ROUND(AVG(population), 2) AS 'Average Population of South American Country in 2003 (mil)'
FROM countries