A)
select decode(count(*), 0, \'N\', \'Y\') rec_exists
from (select \'X\'
from dual
where exists (select \'X\'
from sales
select NVL ((select 'Y' from dual where exists
(select 1 from sales where sales_type = 'Accessories')),'N') as rec_exists
from dual
1.Dual table will return 'Y' if record exists in sales_type table 2.Dual table will return null if no record exists in sales_type table and NVL will convert that to 'N'