Im between cherry

Hackerrank | MySQL | Weather Observation Station 2 본문

데이터분석/practice_query

Hackerrank | MySQL | Weather Observation Station 2

meal 2020. 8. 29. 11:07

Weather Observation Station 2

Problem

 

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.
SELECT ROUND(SUM(LAT_N),2) AS lat, ROUND(SUM(LONG_W),2) AS lon
FROM STATION

 

SELECT round(SUM(LAT_N),2)
	,round(SUM(LONG_W),2)
FROM Station
Comments