World Populations II Challenge Project (SQL)

Hi everyone,
Here is my SOLUTION to the World Populations II Change Project.

Hello everyone, here is my answer :slight_smile:

Hello people, this are my solutions to the project

and here is mine :slight_smile:

Hi! Here is my solution :slight_smile:

Hello All,
My code is not pretty, but I’d like to share anyways… Hope you guys are staying safe and a BIG s/o to CodeAcademy for offering Pro to students!

Here is my code:

Here is my code!!!

Sharing my solution…

Here is my solution:


SELECT SUM(population_years.population) AS Query_04
FROM population_years
JOIN countries ON countries.id=population_years.country_id
WHERE countries.continent='Oceania' AND
population_years.year=2005;;

SELECT AVG(population_years.population) AS Query_05
FROM population_years
JOIN countries ON countries.id=population_years.country_id
WHERE countries.continent='South America' AND
population_years.year=2003;;

SELECT MIN(population) as 'Query_6'
FROM population_years
WHERE year=2007;

SELECT AVG(population_years.population) AS Query_07
FROM population_years
JOIN countries ON countries.id=population_years.country_id
WHERE countries.name='Poland';

SELECT COUNT(*) AS Query_08
FROM countries
WHERE name LIKE '%The%';
--Query 09
SELECT continent ,SUM(population_years.population) total
FROM population_years
JOIN countries ON countries.id=population_years.country_id
WHERE population_years.year=2010
GROUP BY 1;


World Populations SQL Practice II

Good Thinking,
Not knowing where the WORD “The” will be located in the country name, I wrote the following query

SELECT COUNT(*) AS 'counties_with_The_in_name'
FROM countries
WHERE name  LIKE '% The %' OR name LIKE '% The' OR name LIKE 'The %'; 
-- looking for the WORD "The", (the question asks for the word "The", it does not ask for the string made of the letters "The")

to make it shorter isn’t it just WHERE name LIKE ‘%The%’ ??