Problem:-
Solution:-
SELECT
ROUND(
SQRT(
POWER((MAX(Lat_N) - MIN(Lat_N)), 2) +
POWER((MAX(Long_W) - MIN(Long_W)), 2)
)
, 4)
FROM Station;
Consider and to be two points on a 2D plane where are the respective minimum and maximum values of Northern Latitude (LAT_N) and are the respective minimum and maximum values of Western Longitude (LONG_W) in STATION.
Query the Euclidean Distance between points and and format your answer to display decimal digits.
Input Format
The STATION table is described as follows:
![Station.jpg](https://s3.amazonaws.com/hr-challenge-images/9336/1449345840-5f0a551030-Station.jpg)
where LAT_N is the northern latitude and LONG_W is the western longitude.
SELECT
ROUND(
SQRT(
POWER((MAX(Lat_N) - MIN(Lat_N)), 2) +
POWER((MAX(Long_W) - MIN(Long_W)), 2)
)
, 4)
FROM Station;
No comments:
Post a Comment