select t.last_name,t.first_name,d.dept_name from (select e.last_name,e.first_name,de.dept_no from employees as e left join dept_emp as de on de.emp_no = e.emp_no) as t left join departments as d on d.dept_no = t.dept_no;