본문 바로가기
CODING TEST/SQL : HackerRank

[MYSQL] Weather Observation Station 13

by 주 녕 2021. 8. 16.
반응형

 SQL  >  Aggregation > Weather Observation Station 13

 

 Problem 

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.

→ 38.7880보다 크고 137.2345보다 작은 LAT_N의 합을 구하고 4번째 자리에서 내림(turncate)해라

 

Input Format

The STATION table is described as follows:

 My Answer 

SELECT TRUNCATE(SUM(LAT_N), 4)
FROM STATION
WHERE LAT_N > 38.7880 AND LAT_N < 137.2345

 

 NOTE 

내림 함수는 TURNCATE(숫자, 자릿수) 숫자 함수를 사용하자!

MYSQL의 숫자 함수아래 포스팅을 참고!

 

[MYSQL] The Blunder

SQL > Aggregation > The Blunder  Problem Samantha was tasked with calculating the average monthly salaries for all employees in the EMPLOYEES table, but did not realize her keyboard's 0 key was b..

junyoung-developer.tistory.com

 

반응형

'CODING TEST > SQL : HackerRank' 카테고리의 다른 글

[MYSQL] Placements  (0) 2022.10.05
[MYSQL] New Companies  (2) 2022.09.30
[MYSQL] Weather Observation Station 2  (0) 2021.08.09
[MYSQL] Top Earners  (0) 2021.05.26
[MYSQL] The Blunder  (0) 2021.05.18
[MYSQL] Population Density Difference  (0) 2021.05.13
[MYSQL] Japan Population  (0) 2021.05.13
[MySQL] Average Population  (0) 2021.04.21

댓글