일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- airflow
- 카이제곱분포
- 논문리뷰
- MySQL
- HackerRank
- NLP
- sigmoid
- 짝수
- inner join
- torch
- Statistics
- Window Function
- 코딩테스트
- 자연어 논문
- SQL 날짜 데이터
- t분포
- update
- 자연어처리
- 서브쿼리
- sql
- 설명의무
- leetcode
- LSTM
- SQL코테
- GRU
- 표준편차
- 그룹바이
- 자연어 논문 리뷰
- CASE
- nlp논문
- Today
- Total
HAZEL
[SQL : HackerRank] Japan Population / Weather Observation Station 2 / Weather Observation Station 18 본문
[SQL : HackerRank] Japan Population / Weather Observation Station 2 / Weather Observation Station 18
Rmsid01 2021. 2. 25. 11:581] Japan Population
>> 문제
Query the sum of the populations for all Japanese cities in CITY. The COUNTRYCODE for Japan is JPN.
Input Format
The CITY table is described as follows:
>> 문제해결 코드
SELECT SUM(POPULATION)
from CITY
WHERE COUNTRYCODE = 'JPN'
www.hackerrank.com/challenges/japan-population/problem
2] Weather Observation Station 2
>> 문제
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.
>> 문제 해결 코드
SELECT round(sum(lat_n), 2) AS lat , round(sum(long_w), 2) AS lon
FROM STATION
hackerrank.com/challenges/weather-observation-station-2/problem
3] Weather Observation Station 18
>> 문제
Consider P1(a,b ) and P2(c, d) to be two points on a 2D plane.
- a happens to equal the minimum value in Northern Latitude (LAT_N in STATION).
- b happens to equal the minimum value in Western Longitude (LONG_W in STATION).
- c happens to equal the maximum value in Northern Latitude (LAT_N in STATION).
- d happens to equal the maximum value in Western Longitude (LONG_W in STATION).
Query the Manhattan Distance between points p1 and p2 and round it to a scale of 4 decimal places.
: In a plane with p1 at (x1, y1) and p2 at (x2, y2), Manhattan Distance is |x1 - x2| + |y1 - y2|.
Input Format
The STATION table is described as follows:
where LAT_N is the northern latitude and LONG_W is the western longitude.
>> 문제 해결 코드
select ROUND(ABS(min(LAT_N) - max(LAT_N)) + ABS(min(LONG_W) - Max(LONG_W)), 4)
from station
www.hackerrank.com/challenges/weather-observation-station-18/problem