1. Weather Observation Station 13
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
SELECT
TRUNCATE(SUM(LAT_N), 4) AS SUM_LAT
FROM STATION
WHERE LAT_N BETWEEN 38.7880 AND 137.2345
POINT!
TRUNCATE(number, decimals)
: 숫자나 날짜에서 지정한 자리까지 잘라내는(버림하는) 함수
남는 자리는 그대로 버리고, 올림이나 반올림을 하지 않음
- number: 자를 대상 숫자
- decimals: 남길 소수점 자리 수 (0 또는 음수도 가능)
2. Weather Observation Station 14
https://www.hackerrank.com/challenges/weather-observation-station-14/problem?isFullScreen=true
Weather Observation Station 14 | HackerRank
Query the greatest value of the Northern Latitudes from STATION that are under 137.2345 and truncated to 4 decimal places.
www.hackerrank.com
Query the greatest value of the Northern Latitudes (LAT_N) from STATION that is less than 137.2345. Truncate your answer to decimal places.
SELECT
TRUNCATE(MAX(LAT_N), 4) AS MAX_LAT
FROM
STATION
WHERE
LAT_N < 137.2345
3. Weather Observation Station 15
https://www.hackerrank.com/challenges/weather-observation-station-15/problem?isFullScreen=true
Weather Observation Station 15 | HackerRank
Query the Western Longitude for the largest Northern Latitude under 137.2345, rounded to 4 decimal places.
www.hackerrank.com
Query the Western Longitude (LONG_W) for the largest Northern Latitude (LAT_N) in STATION that is less than 137.2345 . Round your answer to 4 decimal places.
SELECT
ROUND(LONG_W, 4) AS LON
FROM
STATION
WHERE
LAT_N < 137.2345
ORDER BY
LAT_N DESC
LIMIT 1;
4. Weather Observation Station 16
https://www.hackerrank.com/challenges/weather-observation-station-16/problem?isFullScreen=true
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.
SELECT
ROUND(MIN(LAT_N), 4) AS MIN_LAT
FROM
STATION
WHERE
LAT_N > 38.7780
5. Weather Observation Station 17
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
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.
SELECT
ROUND(LONG_W, 4) AS MIN_LOG
FROM
STATION
WHERE
LAT_N > 38.7780
ORDER BY
LAT_N ASC
LIMIT 1;'코딩 테스트 > 02. SQL' 카테고리의 다른 글
| [Hacker Rank] SQL Basic 'The PADS' (medium) (3) | 2025.08.17 |
|---|---|
| [Hacker Rank] SQL Basic (easy) (6) (5) | 2025.08.16 |
| [HackerRank] SQL Basic (easy)(4) (2) | 2025.08.14 |
| [HackerRank] SQL Basic (easy)(3) (1) | 2025.08.13 |
| [HackerRank] SQL Basic (easy)(2) (8) | 2025.08.13 |
