I have two tables, one that contains volunteers, and one that contains venues. Volunteers are assigned one venue each.
The id of the venues table (venues.id) is placed within the volunteers table in the venue_id column (volunteers.venue_id).
I know I could get a count of how many matching values are in the volunteers.venue_id column by
SELECT venue_id, COUNT(*) FROM volunteers GROUP BY venue_id
Why I want to do this: so the user can go in and see how many volunteers are assigned to each venue.
table: volunteers -- columns: id, name, venue_id
table: venues -- columns: id, venue_name
volunteers.venue_id = venues.id
I know this would be a join statement of some sort so it will get a count of each venue, then match up volunteers.venue_id to venues.id and print out the venues.venue_name along with the count.
How would I go about joining the two tables to print out the venue name and next to it, list the count of each volunteer with that venue_id?