1.
Select Supplier.sid from Supplier inner join SP on Supplier.sid = SP.sid inner join Part on SP.pid = Part.pid group by Supplier.sid having price> avg(price);
2.
Select sname from Supplier inner join SP on Supplier.sid = SP.sid inner join Part on SP.pid = Part.pid group by Part.pid having price = max(price);
3.
Select Supplier.sid from Supplier inner join SP on Supplier.sid = SP.sid inner join Part on SP.pid = Part.pid group by Supplier.sid having Part.color = 'red' and part.color = 'green';
4.
Select sname,count(Parts.pid) from Supplier inner join SP on Supplier.sid = SP.sid inner join Part on SP.pid = Part.pid group by sname having Part.color = 'red' ;
Do ask if any doubt. Please upvote.
Get Answers For Free
Most questions answered within 1 hours.