I’m doing an SQL practice. I was asked:
What was the total population of the continent of Oceania in 2005?
So I wrote:
SELECT SUM(population) FROM population_years JOIN countries ON population_years.id = countries.id WHERE continent = 'Oceania' AND year = 2005;
and got: 52.81393
The answer from codecademy is:
SELECT SUM(population) FROM population_years INNER JOIN countries ON countries.id = population_years.country_id WHERE year = 2005 AND continent = 'Oceania';
and the outcome: 32.66417
I have compared them many times and still can’t find what I did that affects the code. Can someone help me please?