-
-
Save codecademydev/8ad7b31e47c43e0299f601ec5b1437c2 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_years.population) | |
FROM countries | |
INNER JOIN population_years | |
ON countries.id = population_years.country_id | |
WHERE continent = 'Oceania' | |
AND year = 2005; | |
SELECT AVG(population_years.population) | |
FROM countries | |
INNER JOIN population_years | |
ON countries.id = population_years.country_id | |
WHERE continent = 'South America' | |
AND year = 2003; | |
SELECT countries.name, MIN(population_years.population) | |
FROM countries | |
INNER JOIN population_years | |
ON countries.id = population_years.country_id | |
WHERE population_years.year = 2007; | |
SELECT countries.name, AVG(population_years.population) | |
FROM countries | |
INNER JOIN population_years | |
ON countries.id = population_years.country_id | |
WHERE countries.name = 'Poland'; | |
SELECT COUNT(*) | |
FROM countries | |
WHERE name LIKE '%The%'; | |
SELECT countries.continent, | |
population_years.year, | |
SUM(population_years.population) | |
FROM countries | |
INNER JOIN population_years | |
ON countries.id = population_years.country_id | |
WHERE population_years.year = 2010 | |
GROUP BY 1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment