select e.last_name,e.first_name,ifnull(dep.dept_name,null)
from ((employees e left join dept_emp d on e.emp_no=d.emp_no) m
left join departments dep on m.dept_no=dep.dept_no )