Mysql Join and count for each categories
Hi I have a tables like this
exams
id | exam_name
1 | computer science
2 | Environment science
exam_students
id | exam_id | student_name
1 | 1 | Josh
2 | 1 | Michael
3 | 1 | John
I just need to join and count the total students of each exam and output something like this
exam_name | total_students |
computer science | 3 |
Environment science| 0 |
Thank you for your any help and suggestions