-
-
Save codecademydev/4a9f027ed429732a7ff6afb2bc2cf2a5 to your computer and use it in GitHub Desktop.
Codecademy export
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 COUNT (*) | |
FROM countries | |
WHERE continent = 'Africa'; | |
SELECT SUM(population) | |
FROM population_years | |
JOIN countries | |
ON population_years.country_id = countries.id | |
WHERE year = '2005' | |
AND continent = 'Oceania'; | |
SELECT ROUND(AVG(population), 2) | |
FROM population_years | |
JOIN countries | |
ON population_years.country_id = countries.id | |
WHERE year = '2003' | |
AND continent = 'Oceania'; | |
SELECT MIN(population), name | |
FROM population_years | |
JOIN countries | |
ON population_years.country_id = countries.id | |
WHERE year = '2007'; | |
SELECT ROUND(AVG(population), 2) | |
FROM population_years | |
JOIN countries | |
ON population_years.country_id = countries.id | |
WHERE name = 'Poland'; | |
SELECT COUNT(name) | |
FROM countries | |
WHERE name LIKE '%The%'; | |
SELECT continent, ROUND(SUM(population), 2) AS 'total population' | |
FROM population_years | |
JOIN countries | |
ON population_years.country_id = countries.id | |
WHERE year = '2010' | |
GROUP BY continent; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment