What are the IDs of all the products supplied by supplier 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
What is the average price of these products?
select avg ( t2.product_price ) from product_suppliers as t1 join products as t2 on t1.product_id = t2.product_id where t1.supplier_id = 2
Show me the ID's from the products from supplier number 2 that are more expensive than this average, please.
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 ( t2.product_price ) from product_suppliers as t1 join products as t2 on t1.product_id = t2.product_id where t1.supplier_id = 2 )