해커랭크 Weather Observation Station 13 문제 바로가기

 

문제 해석

Query the sum of Northern Latitudes(LAT_N) from STATION having values greater than 38.7880 and less than 137.2345.
STATION 테이블에서 38.7880보다 크고 137.2345 보다 작은 북위(LAT_N)의 합을 구하는 쿼리를 입력.

Truncate your answer to 4 decimal places.
결과는 소수점 4자리까지 자르기. 

The STATION table is described as follows:

where LAT_N is the northern latitude and LONG_W is the western longitude.

 

문제 풀이

SELECT ROUND(SUM(LAT_N),4)
FROM station
WHERE LAT_N > 38.7880 AND LAT_N < 137.2345

-- 소수점 4자리까지 나타내기 위해 ROUND 반올림함수 사용. 
-- 조건문 WHERE 사용
-- 논리연산자 AND와 비교연산자로 조건 나타냄 (LAT_N > 38.7880 AND LAT_N < 137.2345)

+ Recent posts