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