Weather Observation Station 18

Sort by

recency

|

2475 Discussions

|

  • + 0 comments

    SELECT CAST((C+D) - (A+B) AS DECIMAL(10,4)) AS FCK FROM ( SELECT ROUND(MIN(LAT_N),4) AS A, ROUND(MIN(LONG_W),4) AS B, ROUND(MAX(LAT_N),4) AS C, ROUND(MAX(LONG_W),4) AS D FROM STATION) AS FCKING; =========================================259.6859=================

  • + 0 comments

    Consider and to be two points on a 2D plane.

    happens to equal the minimum value in Northern Latitude (LAT_N in STATION). happens to equal the minimum value in Western Longitude (LONG_W in STATION). happens to equal the maximum value in Northern Latitude (LAT_N in STATION). happens to equal the maximum value in Western Longitude (LONG_W in STATION). Query the Manhattan Distance between points and and round it to a scale of decimal places.

  • + 0 comments

    The Manhattan Distance formula for two points (x1, y1) and (x2, y2) is: DManhattan = (x1−x2) + (y1−y2)

    Applying this to points P1(a, b) and P2(c, d): DManhattan=(a−c) + (b−d)

    SELECT ROUND(ABS((MIN(LAT_N) - MAX(LAT_N))) + ABS((MIN(LONG_W) - MAX(LONG_W))), 4) FROM station

    N.B ABS() (absolute value) function, is crucial for Manhattan distance.

  • + 0 comments

    select round((max(long_w)-min(long_w))+(max(lat_n)-min(lat_n)),4) from station;

  • + 0 comments

    WITH tb AS ( SELECT MAX(LAT_N) AS c, MIN(LAT_N) AS a, MAX(LONG_W) AS d, MIN(LONG_W) AS b FROM STATION ) SELECT CAST(ROUND(ABS(a -c)+ABS(b - d),4) AS DECIMAL(10,4)) as Manhattan_Distance FROM tb;