-
-
Save codecademydev/cbb1686470154a6271739e7350dd0f6b 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(*) AS 'African Countries' | |
FROM countries | |
WHERE continent = 'Africa'; | |
SELECT COUNT(population) AS "Oceania Pop. 2005" | |
FROM population_years | |
CROSS JOIN countries | |
WHERE continent = 'Oceania' AND year = 2005; | |
SELECT ROUND(AVG(population), 2) AS 'Averge Pop in Millions of SouthA.Countries 2003' | |
FROM population_years | |
CROSS JOIN countries | |
WHERE continent = 'South America' AND year = 2003; | |
SELECT name, ROUND(MIN(population), 4) AS 'Smallest Population in Millions' | |
FROM population_years | |
CROSS JOIN countries | |
WHERE year = 2007; | |
SELECT name, ROUND(AVG(population), 2) AS ' Average in Millions' | |
FROM population_years | |
CROSS JOIN countries | |
WHERE name = 'Poland'; | |
SELECT COUNT(*) AS 'Number of countries with The in Name' | |
FROM countries | |
WHERE name LIKE '%The%'; | |
SELECT continent, COUNT(population) | |
FROM countries | |
CROSS JOIN population_years | |
WHERE year = 2010 | |
GROUP BY 1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment