-
-
Save codecademydev/f9a45c6668b27f7353440d8debfbaeb1 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 | |
limit 10; | |
select * | |
from population_years | |
limit 5; | |
select count(*) | |
from countries | |
where continent='Africa'; | |
select year, sum(population), countries.continent | |
FROM population_years | |
JOIN countries | |
on population_years.country_id = countries.id | |
WHERE population_years.year = 2005 | |
AND countries.continent = 'Oceania'; | |
select year, avg(population), countries.continent | |
FROM population_years | |
join countries | |
on population_years.country_id = countries.id | |
WHERE population_years.year = 2003 | |
AND countries.continent = 'South America'; | |
select year, min(population), countries.name | |
from population_years | |
join countries | |
on population_years.country_id = countries.id | |
WHERE population_years.year = 2007; | |
select countries.name, avg(population) | |
from population_years | |
join countries | |
on population_years.country_id = countries.id | |
WHERE countries.name = 'Poland'; | |
select count(*) | |
from countries | |
WHERE name like '%the%'; | |
select year, sum(population), countries.continent | |
FROM population_years | |
JOIN countries | |
on population_years.country_id = countries.id | |
WHERE population_years.year = 2010 | |
group by countries.continent; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment