SESSION NAME: Joins and Unions-1.
QUESTION NAME: Average Population of each continent.
TABLE DESCRIPTION:
Given the CITY and COUNTRY tables, query the names of
all the continents (COUNTRY.Continent) and their
respective average city populations (CITY.Population)
rounded down to the nearest integer.
Note: CITY.CountryCode and COUNTRY.Code are
matching key columns.
all the continents (COUNTRY.Continent) and their
respective average city populations (CITY.Population)
rounded down to the nearest integer.
Note: CITY.CountryCode and COUNTRY.Code are
matching key columns.
CODE:
select COUNTRY.CONTINENT,FLOOR(AVG(CITY.POPULATION)) From CITY
join COUNTRY on CITY.CountryCode = COUNTRY.Code group by COUNTRY.Continent;
0 Comments