I have two tables. (In reality there are more than that, but for the sake of this question, let's say there are two).
Table 1: Contacts
Tabe 2: projects.
Projects is related to contacts in that `projects`.`ownerId` is an integer value that matches `contacts`.`contactId`.
The relatinoship is a one to many. (One contact can have multiple projects).
I want to get a project count for each contact.
So, SELECT * FROM contacts would be the base query. But I want a row for each contact that counts the number of projects they have from the projects table.
The ideal output would be:
Firestname | LastName | Email | Projects
Jim | Smith | email@example.com | 25
What's the SQL query to do this?