일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- matplotlib
- SQLite
- 프로그래머스
- SUM
- not in
- 다중 JOIN
- 머신러닝
- 데이터분석
- 데이터리안 웨비나
- solvesql
- 결측값
- airflow 설치
- 그로스해킹
- pandas
- TRUNCATE
- airflow.cfg
- seaborn
- MySQL
- 데이터시각화
- 전처리
- having
- GROUPBY
- Round
- Oracle
- SQL
- hackerrank
- join
- 파이썬
- PostgreSQL
- Limit
Archives
- Today
- Total
Milky's note
[HackerRank](E) 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.
Input Format
The STATION table is described as follows:
![](https://blog.kakaocdn.net/dn/bkKIMQ/btrxgnKvgM9/btv7ES6PRUZkDASg43XZAk/img.jpg)
where LAT_N is the northern latitude and LONG_W is the western longitude.
[답]
-mysql
select round(long_w,4) from station
where lat_N < 137.2345
order by lat_n desc
limit 1
주어진 조건보다 큰 값 중 가장 큰 lat_n에 대하여 long_w를 구해주는 문제이다.
가장 큰 값을 구하기 위해 order by를 desc로 정렬한 뒤 limit를 1 해주었다.
'SQL > SQL 코딩 테스트-HackerRank' 카테고리의 다른 글
[HackerRank](E) Weather Observation Station 17 (0) | 2022.03.25 |
---|---|
[HackerRank](E) Weather Observation Station 16 (0) | 2022.03.25 |
[HackerRank](E) Weather Observation Station 14 (0) | 2022.03.25 |
[HackerRank](E) Weather Observation Station 13 (0) | 2022.03.25 |
[HackerRank](E) Weather Observation Station 2 (0) | 2022.03.25 |
Comments