Milky's note

[HackerRank](E) Weather Observation Station 2 본문

SQL/SQL 코딩 테스트-HackerRank

[HackerRank](E) Weather Observation Station 2

밀뿌 2022. 3. 25. 17:29

https://www.hackerrank.com/challenges/weather-observation-station-2/problem?isFullScreen=true 

 

Weather Observation Station 2 | HackerRank

Write a query to print the sum of LAT_N and the sum of LONG_W separated by space, rounded to 2 decimal places.

www.hackerrank.com

 

[문제]

Query the following two values from the STATION table:

  1. The sum of all values in LAT_N rounded to a scale of  decimal places.
  2. The sum of all values in LONG_W rounded to a scale of  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 round(sum(lat_n),2), round(sum(long_W),2)
from station

각각 위도와 경도 값을 모두 더해서 소수점 2째자리까지 반올림 해주면 된다.

Comments