Explain with examples for the Subqueries with IN and NOT IN.
Sub Query Example with IN: Displays employees from employee table with bonus > 1000. Using IN first all employees are selected and compared to each row of the subquery. Select first_name from employee
Where bonus_id IN (select id from bonus Where bonus_amt > 1000);
Sub Query Example with NOT IN: Displays employees from employee table with bonus < 1000. Using NOT IN first all employees are selected and compared to each row of the subquery.
Select first_name from employee Where bonus_id NOT IN (select id from bonus Where bonus_amt < 1000);