Weather Observation Station 19

  • + 0 comments

    SELECT ROUND( SQRT(POW(MAX(LAT_N) - MIN(LAT_N), 2) + POW(MAX(LONG_W) - MIN(LONG_W), 2)), 4 ) AS Euclidean_Distance FROM STATION;

    Explanation: MIN(LAT_N): This gets the minimum value of Northern Latitude. MAX(LAT_N): This gets the maximum value of Northern Latitude. MIN(LONG_W): This gets the minimum value of Western Longitude. MAX(LONG_W): This gets the maximum value of Western Longitude. The POW function is used to square the differences between the respective coordinates. The SQRT function calculates the square root of the sum of the squared differences to get the Euclidean distance. ROUND(..., 4): This rounds the final distance to 4 decimal places.