HackerRank SQL

Weather Observation Station 17

Problem:

Query the Western Longitude (LONG_W)where the smallest Northern Latitude (LAT_N) in STATION is greater than 38.7780. Round your answer to 4 decimal places.

Input Format

The STATION table is described as follows:

where LAT_N is the northern latitude and LONG_W is the western longitude.

Logic:

Use order by limit 1 for the smallest value

Solution:

SELECT ROUND(LONG_W, 4) FROM STATION WHERE LAT_N > 38.7780 ORDER BY LAT_N LIMIT 1;

Link

--

--

--

My homepage to record my thought processes for solving SQL and Algorithm questions

Recommended from Medium

A Handbook to Implement Fuzzy Search in PostgreSQL

Storm Events Dataset Schema

Get Your Android App Ready for Chromebooks

“All Clear” for IoT-Based Railway Analytics

python language review:

Prerequisites to Cloud-native software

I Am Now a ”Real” Content Modelist

The Architect from ”Matrix Reloaded.”

How important are the static libraries?

gRPC with Python

Example how gRPC request and response flows

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Isabelle

Isabelle

In love with telling stories with data

More from Medium

SQL Queries

SQL — 102 (Basics)

COALESCE function in SQL