HackerRank/SQL

[hackerrank] Weather Observation Station 2

예쁜꽃이피었으면 2022. 8. 31. 10:46

[hackerrank] Prepare > SQL > Aggregation > Weather Observation Station 2

 

[문제]

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.

Output Format

Your results must be in the form:

lat lon

where  is the sum of all values in LAT_N and  is the sum of all values in LONG_W. Both results must be rounded to a scale of  decimal places.

 

[MYSQL]

 

 

[ORCALE]

select round(sum(lat_n),2) , round(sum(long_w),2) 
from station ;

 

 

 

반응형

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

[hackerrank] Weather Observation Station 14  (0) 2022.08.31
[hackerrank] Weather Observation Station 13  (0) 2022.08.31
[hackerrank] Top Earners  (0) 2022.08.31
[hackerrank] The Blunder  (0) 2022.08.25
[hackerrank] Population Density Difference  (0) 2022.08.24