Search⌘ K
AI Features

Challenge: Search for the Nearest Circuits

Explore how to write SQL queries in PostgreSQL to locate the nearest circuits based on geographic coordinates. Understand how to use geolocation data with built-in functions and extensions to retrieve relevant circuit information such as name, location, and country.

Problem statement

Here is a table for circuits. The data in the circuits table looks like the following:

-[ RECORD 1 ]----------------------------------------------------------
circuitid  | 1
circuitref | albert_park
name       | Albert Park Grand Prix
...