일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 | 31 |
Tags
- Oracle
- 데이터리안 웨비나
- Limit
- GROUPBY
- 그로스해킹
- not in
- pandas
- 프로그래머스
- SQL
- 머신러닝
- 다중 JOIN
- 결측값
- seaborn
- 전처리
- 파이썬
- TRUNCATE
- PostgreSQL
- solvesql
- 데이터분석
- SUM
- hackerrank
- join
- airflow 설치
- Round
- 데이터시각화
- having
- matplotlib
- SQLite
- airflow.cfg
- MySQL
Archives
- Today
- Total
Milky's note
[HackerRank](E) 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
[문제]
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.
Input Format
The STATION table is described as follows:

where LAT_N is the northern latitude and LONG_W is the western longitude.
[답]
-mysql
select truncate(sum(lat_n),4) from station
where lat_n > 38.7880
and lat_n < 137.2345
해당 조건에 맞는 값들의 합을 출력하는데 반올림이 아니고 4자리까지 버림을 사용해야하므로 truncate를 사용해주었다.
'SQL > SQL 코딩 테스트-HackerRank' 카테고리의 다른 글
[HackerRank](E) Weather Observation Station 15 (0) | 2022.03.25 |
---|---|
[HackerRank](E) Weather Observation Station 14 (0) | 2022.03.25 |
[HackerRank](E) Weather Observation Station 2 (0) | 2022.03.25 |
[HackerRank](E) Top Earners (0) | 2022.03.25 |
[HackerRank](E) The Blunder (0) | 2022.03.25 |
Comments