CodingSpace

[HackerRank/SQL] Revising Aggregations - Population Density Difference 본문

HackerRank/SQL

[HackerRank/SQL] Revising Aggregations - Population Density Difference

개발자_조이킴 2022. 7. 17. 02:16

Problem. Revising Aggregations - Population Density Difference


Link.

https://www.hackerrank.com/challenges/population-density-difference/problem?isFullScreen=true

 

Average Population | HackerRank

Query the average population of all cities, rounded down to the nearest integer.

www.hackerrank.com


Description.

Query the difference between the maximum and minimum populations in CITY.

CITY 테이블


Key Point. 

SELECT,

 

AVG,

 

ROUND,


My Answer. 

SELECT MAX(POPULATION) - MIN(POPULATION)
FROM CITY;

References. 

 

Comments