--subquery always returns a row

select 'mary' as mary
where exists (select null)

select * from products
where exists ( select count(*) from products where price > 3000);

--subquery may or may not return a row
select * from products
where exists ( select * from products where price > 300);

select * from products
where exists ( select * from products where price > 3000);

select 'has product MS' as MS
where exists ( select product_id from products where product_name = 'MS' )

select 'Not has product MS' as MS
where not exists ( select product_id from products where product_name = 'MS' );

select * from products p 
where exists ( select * from   categories c where c.category_id  = p.category_id);