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:
- The sum of all values in LAT_N rounded to a scale of 2 decimal places.
- The sum of all values in LONG_W rounded to a scale of 2 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.
Output Format
Your results must be in the form:
lat lon
where LAT is the sum of all values in LAT_N and LON is the sum of all values in LONG_W. Both results must be rounded to a scale of 2 decimal places.
[My Answer]
SELECT
ROUND(SUM(LAT_N),2),
ROUND(SUM(LONG_W), 2)
FROM STATION
좌표찍는것 문제.
ROUND를 통해서 소수점 정해주고 그 안에 sum(value)
'Code Problems > SQL_ HackerRank' 카테고리의 다른 글
[HackerRank] Weather Observation Station 14 (0) | 2021.11.11 |
---|---|
[HackerRank] Weather Observation Station 13 (0) | 2021.11.11 |
[Hacker Rank] Top Earners (0) | 2021.11.07 |
[HackerRank] The Blunder (0) | 2021.11.07 |
[HackerRank] Revising Aggregations, Populations (0) | 2021.11.07 |