Select out of following the code which uses a JOIN to show a list of all the departments and number of employed teachers
WA:
SELECT dept.name, COUNT(teacher.name) FROM teacher JOIN dept ON dept.id = teacher.dept GROUP BY dept.name
AC:
SELECT dept.name, COUNT(teacher.name) FROM teacher RIGHT JOIN dept ON dept.id = teacher.dept GROUP BY dept.name
so the difference between join and right join is :
if a department has no teacher at present, in WA solution, it will not appear;
but in AC solution, it can appear.