코딩공부
[HackerRank] SQL / Basic Join / Easy / Average Population of Each Continent
geraedo
2024. 12. 22. 14:51
문제:
https://www.hackerrank.com/challenges/average-population-of-each-continent/problem?isFullScreen=true
Average Population of Each Continent | HackerRank
Query the names of all continents and their respective city populations, rounded down to the nearest integer.
www.hackerrank.com
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.
모든 대륙의 이름과 평균 도시 인구를 정수로 내림하라는 문제입니다.
문제 해결:
실패
left join 을 하니 null값이 나와서 실패했다.
각 테이블에 있는 값들을 매칭하기 위해 inner join해야 함을 알았다.
성공
피드백
문제를 정확히 파악하는게 좀 쉽지 않다. inner join인지 left join인지 ..