-
-
Save codecademydev/a29f2db18cef94ef1d3132c123beae86 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 * | |
FROM countries | |
WHERE continent = "Oceania"; | |
SELECT * | |
FROM population_years | |
WHERE year = 2005; | |
SELECT SUM(population) | |
FROM population_years | |
INNER JOIN countries | |
ON population_years.id = countries.id | |
WHERE continent = "Oceania" AND year = 2005; | |
SELECT AVG(population) | |
FROM population_years | |
INNER JOIN countries | |
ON population_years.id = countries.id | |
WHERE continent = "South America" AND year = 2003; | |
SELECT DISTINCT name, | |
population, | |
year | |
FROM countries | |
INNER JOIN population_years | |
ON countries.id = population_years.country_id | |
WHERE year = 2007 AND population IS NOT NULL | |
ORDER BY population ASC | |
LIMIT 1; | |
SELECT AVG(population) | |
FROM population_years | |
INNER JOIN countries | |
ON population_years.country_id = countries.id | |
WHERE name = "Poland"; | |
SELECT COUNT(*) | |
FROM countries | |
WHERE name LIKE "%The%"; | |
SELECT SUM(population), | |
continent | |
FROM population_years | |
INNER 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