I have two shapefiles: One point file (occ_master) and 1 polygon file (geol_1m). The point file represents mineral occurrences. The polygon file represents geology, which can be subcategorized by field lith_name, as displayed in the image. I need to find a way to determine how many mineral occurrences (points) occur in each lith_name. This query will allow me to figure out which geological unit has the most mineral occurrences.
I know it will involve a ST_Contains and GROUP BY query but it is my first day on PostGIS and so I am rather inexperienced.