I have table for Job position and Employees
tbl_job_position:
job_id, job_description, job_quantity(number of max vacant)
1 Programmer 3
2 Accountant 2
3 Driver 3
4 HR Officer 2
tbl_employee:
emp_id, emp_pos_id
1 1
2 1
3 2
4 3
5 3
6 3
I would like to create a report resulting to this:
job_position, no_of_active_emp, no_of_vacancies
Programmer 2 1
Accountant 1 1
Driver 3 0
HR Officer 0 2
How can I query this in mysql? Any help would be appreciated, Thank you.