Write nested and complex queries using multiple tables

 

SQL> select *
2 from dependent
3 where essn in (select ssn
4 from employee
5 where dno='4');
ESSN DEPENDENT_NAME SEX BDATE
-------------------- -------------------- -------------------- ---------
RELATIONSHIP PHONE_NUMBER
-------------------- ------------
7894 diganth m 01-MAR-92
husband