/*
HACKER RANK MYSQL SOLUTION.
*/
SET @rowindex := -1;
SELECT
ROUND(AVG(N.LAT_N),4)
FROM
(SELECT @rowindex:=@rowindex + 1 AS rowindex,
STATION.LAT_N AS LAT_N
FROM STATION
ORDER BY STATION.LAT_N) AS N
WHERE
N.rowindex IN (FLOOR(@rowindex / 2) , CEIL(@rowindex / 2));