I have the below tables.The first one has posts with a foreign key to a category table.I'm looking for a query that gives me the amount of posts on every category.
The post table.
select pstOccuId,pstTitle from job_post;
+-----------+-------------------------------------------+
| pstOccuId | pstTitle |
+-----------+-------------------------------------------+
| 1 | Software Engineer Recruit |
| 1 | Web Developer Recruit |
| 7 | Saxophonist |
| 5 | Construction Company looking for plumber. |
+-----------+-------------------------------------------+
The category table.
select occuDscr,occuId from occupation_field;
+---------------------+--------+
| occuDscr | occuId |
+---------------------+--------+
| Software Engineer | 1 |
| Economics | 2 |
| Structural Engineer | 3 |
| Legal Advisors | 4 |
| Plumbers | 5 |
| Social Advisors | 6 |
| Musicians | 7 |
+---------------------+--------+
I'm looking for a query that gives me something like this.
+---------------------+--------+
| occuDscr | amount |
+---------------------+--------+
| Software Engineer | 2 |
| Plumbers | 1 |
| Musicians | 1 |
+---------------------+--------+