SQL SELECT Statement | Sololearn: Learn to code for FREE!

+2

SQL SELECT Statement

Consider the following schema: ========================== Suppliers(sid, sname, address) Parts(pid, pname, color) Catalog (sid, pid, cost) Question: ======== List supplier name who supply the product cheaper than the other supplier for pid "P01". My Attempt: ========== select s.sname from Suppliers s, Catalog c where s.sid=c.sid and c.cost<c.cost(c.pid('P01'))

10/30/2021 9:16:03 AM

Arun Bhattacharya

3 Answers

New Answer

+1

select s.sname from Suppliers s, Catalog c where s.sid = c.sid and c.pid in ( select p.pid from Parts p, Catalog cc where p.pid = cc.pid and p.pid = 'P01' and c.cost < cc.cost ) I think this is the solution Keep learning & happy coding :D

+2

Can you tell me the module number and the the id like 9.2...

+2

Can you tell me what is the name of the project?