[HackerRank SQL] Average Population of Each Continent
2423 ワード
質問リンク
https://www.hackerrank.com/challenges/average-population-of-each-continent/problem
Code link
https://github.com/JamesJung01/Hackerrank_sql/blob/main/01_Easy/Average_Population_of_Each_Continent.sql
Case 1
https://www.hackerrank.com/challenges/average-population-of-each-continent/problem
Code link
https://github.com/JamesJung01/Hackerrank_sql/blob/main/01_Easy/Average_Population_of_Each_Continent.sql
Case 1
SELECT COUNTRY.CONTINENT, FLOOR(AVG(CITY.POPULATION))
FROM COUNTRY
JOIN CITY
ON COUNTRY.CODE = CITY.COUNTRYCODE
GROUP BY COUNTRY.CONTINENT;
Case 2SELECT COUNTRY.CONTINENT, TRUNCATE(AVG(CITY.POPULATION),0)
FROM COUNTRY
JOIN CITY
ON COUNTRY.CODE = CITY.COUNTRYCODE
GROUP BY COUNTRY.CONTINENT;
Reference
この問題について([HackerRank SQL] Average Population of Each Continent), 我々は、より多くの情報をここで見つけました https://velog.io/@jamesjung12/HackerRank-SQL-Average-Population-of-Each-Continentテキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol