일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
29 | 30 |
- t분포
- 자연어 논문 리뷰
- HackerRank
- SQL 날짜 데이터
- 논문리뷰
- Statistics
- CASE
- 자연어 논문
- 그룹바이
- 서브쿼리
- 표준편차
- 코딩테스트
- GRU
- sigmoid
- sql
- MySQL
- torch
- 설명의무
- update
- 카이제곱분포
- LSTM
- NLP
- SQL코테
- airflow
- Window Function
- nlp논문
- 짝수
- 자연어처리
- leetcode
- inner join
- Today
- Total
HAZEL
[SQL : HackerRank] Weather Observation Station 3 / Weather Observation Station 19 본문
[SQL : HackerRank] Weather Observation Station 3 / Weather Observation Station 19
Rmsid01 2021. 3. 1. 12:461] Weather Observation Station 3
>> 문제
Query a list of CITY names from STATION for cities that have an even ID number. Print the results in any order, but exclude duplicates from the answer.
The STATION table is described as follows:
where LAT_N is the northern latitude and LONG_W is the western longitude.
>> 문제 푼 코드
SELECT distinct city
FROM STATION
WHERE id % 2 = 0
www.hackerrank.com/challenges/weather-observation-station-3/problem
2] Weather Observation Station 19
Consider P1(a,c) and P2(b,d) to be two points on a 2D plane where (a,b) are the respective minimum and maximum values of Northern Latitude (LAT_N) and (c,d) are the respective minimum and maximum values of Western Longitude (LONG_W) in STATION.
Query the Euclidean Distance between points P1 and P2 and format your answer to display 4 decimal digits.
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(SQRT(POWER(min(lat_n) - max(lat_n),2) +
POWER(min(long_w)- max(long_w),2)),4)
from station
www.hackerrank.com/challenges/weather-observation-station-19/problem
'DATA ANALYSIS > SQL' 카테고리의 다른 글
[SQL : HackerRank] Binary Tree Nodes (0) | 2021.03.03 |
---|---|
[SQL : LEFT JOIN ] HackerRank : Placements (0) | 2021.03.02 |
[SQL : HackerRank] Top Competitors (0) | 2021.02.28 |
[SQL : HackerRank] Population Density Difference , Weather Observation Station 11, Weather Observation Station 13 (0) | 2021.02.27 |
[SQL : select 서브쿼리, join ] HackerRank : New Companies (0) | 2021.02.26 |