새소식

IT/SQL

[해커랭크] Average Population

  • -
728x90
반응형

문제링크 : https://www.hackerrank.com/challenges/average-population/problem?isFullScreen=true

 

Query the average population for all cities in CITY, rounded down to the nearest integer.

Input Format

The CITY table is described as follows: 

 

🔉 문제 설명

모든 CITY의 인구의 평균을 쿼리

rounded down : 소수 끝자리를 자르고 정수로 쿼

 

SELECT TRUNCATE(AVG(POPULATION),0)
FROM CITY

 


ROUND : 반올림

TRUNCATE : 끝자리 버리기(반드시 버릴 자릿수 명시해야 함)

728x90
Contents

포스팅 주소를 복사했습니다

이 글이 도움이 되었다면 공감 부탁드립니다.