-- better one
select buyer_id
from Sales left outer join Product on Sales.product_id = Product.product_id
group by buyer_id having sum(product_name='S8')>0 and sum(product_name='iPhone')=0;
-- mine
select distinct buyer_id from Sales
where buyer_id in
(select distinct buyer_id from Sales as s inner join Product as p on s.product_id = p.product_id where product_name = 'S8')
and buyer_id not in
(select distinct buyer_id from Sales as s inner join Product as p on s.product_id = p.product_id where product_name = 'iPhone') ;
-- better one
select buyer_id
from Sales left outer join Product on Sa