Last active
April 6, 2020 23:34
-
-
Save Sudhir-KNair/2de0aa4ff43c4b2084c115d03ace0a58 to your computer and use it in GitHub Desktop.
Codeacademy world population
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 like '%africa%'; | |
select continent,round(sum(population),2) as 'Total Population' from population_years | |
join | |
countries | |
on countries.id = population_years.country_id | |
where continent like '%Oceania%' AND year = 2005 | |
group by continent; | |
select continent,round(AVG(population),2) as 'Average Population' from population_years | |
join | |
countries | |
on countries.id = population_years.country_id | |
where continent like '%South America%' AND year = 2003 | |
group by continent; | |
Select name,min(population) from population_years | |
join | |
countries | |
on countries.id = population_years.country_id | |
where year = 2007; | |
select name,round(AVG(population),2) as 'Average Population' from population_years | |
join | |
countries | |
on countries.id = population_years.country_id | |
where name like '%Poland%' | |
group by name; | |
select count(*) FROM countries | |
where name like '%The%'; | |
select continent,round(sum(population),2) as 'Total Population' from population_years | |
join | |
countries | |
on countries.id = population_years.country_id | |
where year = 2005 | |
group by continent; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment