Great! Of course, don't forget that you can also put spatial functions inside aggregates. Take a look at how that's done:
FROM sf_planning_districts sfn
JOIN sf_hotels sfh
GROUP BY sfn.name
ORDER BY SUM(
The query above finds the total area of all hotels in each district. In order to find the area of each hotel, we have to first use
ST_Area with a hotel's boundaries as the argument. Then, we have to sum all such areas in a given district, so we use
ST_Area(...) as its argument.