www.hackerrank.com/challenges/weather-observation-station-1/problem
Query a list of CITY and STATE from the STATION table.
The STATION table is described as follows:
where LAT_N is the northern latitude and LONG_W is the western longitude.
Answer
select city, state
from station;
www.hackerrank.com/challenges/weather-observation-station-2/problem
Query the following two values from the STATION table:
- The sum of all values in LAT_N rounded to a scale of decimal places.
- 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.
select round(sum(lat_n),2), round(sum(long_w),2)
from station
728x90
반응형
'SQL & DB > HackerRank SQL Problem' 카테고리의 다른 글
[HackerRank SQL] Weather Observation Station 11, 12(MySQL) (0) | 2021.02.27 |
---|---|
[HackerRank SQL] Weather Observation Station 9, 10(MySQL) (0) | 2021.02.27 |
[HackerRank SQL] Weather Observation Station 7, 8(MySQL) (0) | 2021.02.27 |
[HackerRank SQL] Weather Observation Station 5, 6(MySQL) (0) | 2021.02.27 |
[HackerRank SQL] Weather Observation Station 3, 4(MySQL) (0) | 2021.02.27 |