Only this week, get the SQL Complete Track of 9 courses in a special prize of $330 $89!
Relationships Between Geometries
13. Additional exercise 2
ST_Distance and ST_Dwithin
Spatial joins practice


Perfect! Let's do one more exercise of this kind.


Find all restaurants in every district adjacent to the 'Golden Gate Park' district. Show name and coordinates from the sf_restaurants table.

Stuck? Here's a hint!

First, you have to join the table with itself and use the ST_Touches function to find all adjacent districts. Then you must join the sf_restaurants table and use the ST_Within or ST_Contains function to find all the restaurants that are inside these districts.