I have a Database Table of Jobs. Each Job was created by a User. There are many users. The User Table contains the user_id and the users email address.
---------------
**JOBS_TABLE**
---------------
JOB_ID
USER_ID
---------------
---------------
**USERS_TABLE**
---------------
USER_ID
USER_EMAIL
---------------
I want to know how many Jobs each user has created. Is it possible to do this in just SQL?
Ideally I would like the results like this.
------------------------------
|USER_ID|JOB_COUNT|USER_EMAIL|
------------------------------
|user1 |2000 |[email protected] |
|user2 |5433 |[email protected]|
------------------------------
This is once off report so I am not worried about performance. I am using MySQL.
Thanks