Weather Observation Station 19 | HackRank
Shrikesh M.
An Experienced IT Administrator | Windows server| CCNA | AZURE Database Administrator Associate |A+
Welcome People, Bots & Algo’s of THE INTERWEBS. This is the Thursday Edition of The Analyst.
?
Weather Observation Station 19
?
SELECT CAST(SQRT(SQUARE(MIN(LAT_N)-MAX(LAT_N)) + SQUARE(MIN(LONG_W)-MAX(LONG_W))) AS DECIMAL(9,4))
FROM STATION
?
Cast :These functions convert an expression of one data type to another.
Decimal
Because you are casting as Decimal? that’s why it reads as decimal.
The? DECIMAL(9,4) 9 means their can be up to 9 digits before the period.
The ,4 means their can be up to 4 digits after the period.
Square : is the variable name
SQRT : is the function to square the whole sum