Algorithm/SQL
[SQL][HackerRank] Weather Observation Station 16
융무
2020. 6. 12. 13:50
Weather Observation Station 16 | HackerRank
Query the smallest of STATION's Northern Latitudes that is greater than 38.7780, and round to 4 decimal places
www.hackerrank.com
Query the smallest Northern Latitude (LAT_N) from STATION that is greater than 38.7780. Round your answer to 4 decimal places.
Input Format
The STATION table is described as follows:
where LAT_N is the northern latitude and LONG_W is the western longitude.
- query the smallest LAT_N ==> SELECT MIN(LAT_N)
- round answer to 4 deciaml places ==> SELECT ROUND(MIN(LAT_N), 4)
- from STATION table ==> FROM STATION
- greater than 38.7880 ==> WHERE LAT_N > 38.7780
SELECT ROUND(MIN(LAT_N), 4)
FROM STATION
WHERE LAT_N > 38.7780;
SELECT ROUND(LAT_N,4)
FROM STATION
WHERE LAT_N > 38.7780
ORDER BY LAT_N LIMIT 1;