Save up to $499! Grab all Python courses for $49 or all online courses we’ve ever launched for only $169. Only Feb 11-16. Happy Valentine's!
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.