Shortest Distance in a Plane

Ninja
0/200
Average time to solve is 40m

Problem statement

Table point_2d holds the coordinates (x,y) of some unique points (more than two) in a plane.


Write a query to find the shortest distance between these points rounded to 2 decimals.


| x  | y  |
|----|----|
| -1 | -1 |
| 0  | 0  |
| -1 | -2 |


The shortest distance is 1.00 from point (-1,-1) to (-1,2). So the output should be(no need to round off):


| shortest |
|----------|
| 1    |


Note: The longest distance among all the points are less than 10000.
Solution
(100% EXP penalty)
Shortest Distance in a Plane
Console