CodingSpace

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

HackerRank/SQL

[HackerRank/SQL] Aggregation - Weather Observation Station 17

개발자_조이킴 2022. 8. 2. 09:05

Problem. Basic Select - Weather Observation Station 17


Link.

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

 

Weather Observation Station 17 | HackerRank

Query the Western Longitude for the smallest value of the Northern Latitudes greater than 38.7780 in STATION and round to 4 decimal places.

www.hackerrank.com


Description.

Query the Western Longitude (LONG_W)where the smallest Northern Latitude (LAT_N) in STATION is greater than 38.7780.

Round your answer to 4 decimal places.

 

STATION 테이블


Key Point. 

ROUND,

 

MIN,


My Answer. 

SELECT
ROUND(LONG_W, 4)
FROM STATION
WHERE LAT_N = (SELECT MIN(LAT_N) FROM STATION WHERE LAT_N > 38.7780);

References. 

Comments