Problem Solving

[MySQL] Average Population of Each Continent | Join

luminous13 2022. 4. 6. 15:08

풀이

 

- 대륙의 이름과 각 대륙의 평균 도시 인구수를 조회하세요

- 각 대륙의 평균 도시 인구수는 소수점 아래는 내림합니다.

 

풀이

select country.continent, floor(avg(city.population)) 
from city
join country
on city.countrycode = country.code
group by country.continent