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!
Introduction
Functions returning geometries
Collections
12. ST_NumGeometries
Summary

Instruction

Great! The second function is ST_NumGeometries(geometry). It returns the number of elements in a collection. Here's an example:

SELECT
  id, 
  ST_NumGeometries(geo_data) 
FROM sf_chains;

The query above will show the id of each collection together with the number of elements it contains.

Exercise

How many Royal Crown ATMs are there in the collection with id = 76?

Stuck? Here's a hint!

Simply use the ST_NumGeometries on the geo_data column.