728x90
❓ Question
https://www.hackerrank.com/challenges/average-population
Average Population | HackerRank
Query the average population of all cities, rounded down to the nearest integer.
www.hackerrank.com

❗ Answer
SELECT FLOOR(AVG(population))
FROM city;
📌 Discussion
- avg로 집계 후 floor로 버림
'SQL 문제풀이' 카테고리의 다른 글
| [해커랭크 SQL] Aggregation - Population Density Difference (0) | 2023.08.23 |
|---|---|
| [해커랭크 SQL] Aggregation - Japan Population (0) | 2023.08.23 |
| [해커랭크 SQL] Aggregation - Revising Aggregations - Averages (0) | 2023.08.23 |
| [해커랭크 SQL] Aggregation - Revising Aggregations - The Sum Function (0) | 2023.08.23 |
| [해커랭크 SQL] Basic Join - Average Population of Each Continent (0) | 2023.08.23 |