select e.empno,e.ename,d.dnamefrom dept d left outer join emp eon e.deptno = d.deptnowhere d.deptno = 40;