Show me all the products.
select * from products
Which products are supplied by supplier id 2?
select t1.product_id from product_suppliers as t1 join products as t2 on t1.product_id = t2.product_id where t1.supplier_id = 2
Which products are more expensive than the average price of all products?
select product_id from products where product_price > (select avg(product_price) from products)
Return ids of all the products that are supplied by supplier id 2 and are more expensive than the average price of all products.
select t1.product_id from product_suppliers as t1 join products as t2 on t1.product_id = t2.product_id where t1.supplier_id = 2 and t2.product_price > (select avg(product_price) from products)