> For the complete documentation index, see [llms.txt](https://dshub.gitbook.io/ds-hub/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dshub.gitbook.io/ds-hub/sql/sql-practice/popular-websites-for-sql-practice/hackerrank/sql-basic/weather-observation-station-19.md).

# Weather Observation Station 19

[Question Link](https://www.hackerrank.com/challenges/weather-observation-station-19/problem?isFullScreen=true)

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**.&#x20;

Query the [Euclidean Distance](https://en.wikipedia.org/wiki/Euclidean_distance) between points ***P1*** and ***P2*** and round it to a scale of 4 decimal digits.<br>

The **STATION** table is described as follows: \
![](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.

```sql
SELECT 
    ROUND(SQRT(
        POWER(MAX(lat_n)-MIN(lat_n),2) + 
        POWER(MAX(long_w)-MIN(long_w),2)),4)
FROM Station
```
