Weather Observation Station 2 SQL Hacker Rank Solution

Hello coders, In this post, you will learn how to solve the Weather Observation Station 2 SQL Hacker Rank Solution. This problem is a part of the SQL Hacker Rank series.

Weather Observation Station 2 SQL Hacker Rank Solution
Weather Observation Station 2 SQL Hacker Rank Solution

Weather Observation Station 2 SQL Hacker Rank Solution

Problem

Query the following two values from the STATION table:

  1. The sum of all values in LAT_N rounded to a scale of 2 decimal places.
  2. 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:

Station.jpg

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.

Weather Observation Station 2 SQL Hacker Rank Solution

SELECT ROUND(SUM(LAT_N), 2), ROUND(SUM(LONG_W), 2) FROM STATION;

Disclaimer: The above Problem (Weather Observation Station 2) generated by Hackerrank but the Solution is Provided by Chase2Learn. This tutorial is only for Educational and Learning purposes.

Sharing Is Caring