Tables to be used:
1. scott.emp
2. scott.dept
For all deptno s in dept table if there is atleast 1 employee present in the emp table the output should be 1 else the output should be 0.
For example, deptno 40 in dept table do not have any employees present in the emp table so the output should be 0.
Desired output:
REQ
----------
0
Now If I add a row into the emp table whose deptno is 40 ( Now For all deptnos in dept table there is atleast 1 emp record) , the output should be 1
REQ
----------
1
I have formed query as below but not sure how to proceed furthur
select count(empno),deptno from emp group by deptno