CodingSpace

[HackerRank/SQL] Aggregation - Weather Observation Station 13 본문

HackerRank/SQL

[HackerRank/SQL] Aggregation - Weather Observation Station 13

개발자_조이킴 2022. 7. 31. 23:41

Problem. Basic Select - Weather Observation Station 11


Link.

https://www.hackerrank.com/challenges/weather-observation-station-13/problem?isFullScreen=true 

 

Weather Observation Station 13 | HackerRank

Query the sum of Northern Latitudes having values greater than 38.7880 and less than 137.2345, truncated to 4 decimal places.

www.hackerrank.com


Description.

Query the sum of Northern Latitudes (LAT_N) from STATION having values greater than 38.7880 and less than 137.2345.

Truncate your answer to 4 decimal places.

 

STATION 테이블


Key Point. 

TRUNCATE,

 

SUM,

 

BETWEEN 'A' AND 'B',


My Answer. 

SELECT
TRUNCATE(SUM(LAT_N), 4)
FROM STATION
WHERE LAT_N BETWEEN 38.7880 AND 137.2345;

References. 

Comments