SELECT * FROM DEPT D WHERE EXISTS(SELECT 1 FROM EMP2 E WHERE D.DEPTNO = E.DEPTNO);
SELECT * FROM DEPT D WHERE NOT EXISTS(SELECT 1 FROM EMP2 E WHERE D.DEPTNO = E.DEPTNO);