[코드카타] SQL 71 Weather Observation Station 19

Data_Student·2024년 12월 16일
0

코드카타

목록 보기
81/82
post-thumbnail

[코드카타] SQL 71 Weather Observation Station 19

71. Weather Observation Station 19
https://www.hackerrank.com/challenges/weather-observation-station-19/problem?isFullScreen=true

Consider P1(a,b) and (P2(c,d) to be two points on a 2D plane where (a,c) 
are the respective minimum and maximum values of Northern Latitude (LAT_N) 
and (b,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  decimal digits.
select round(sqrt(pow((min(lat_n)-max(lat_n)),2) + pow((min(long_w)-max(long_w)),2)),4)
from station
유클리드 거리 공식을 활용한 문제 해결
필요한 함수 : sqrt() - 제곱근, pow() - 제곱
  • 유클리드 거리 공식

0개의 댓글