+ 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'))
3 Answers
+ 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
+ 3
Can you tell me what is the name of the project?
+ 2
Can you tell me the module number and the the id like 9.2...