+ 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'))

30th Oct 2021, 9:16 AM
Arun Bhattacharya
Arun Bhattacharya - avatar
3 Respuestas
+ 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
30th Oct 2021, 10:07 AM
SoloProg
SoloProg - avatar
+ 3
Can you tell me what is the name of the project?
30th Oct 2021, 10:13 AM
ÃÑSHÙ KHÁÑRÂ
ÃÑSHÙ KHÁÑRÂ - avatar
+ 2
Can you tell me the module number and the the id like 9.2...
30th Oct 2021, 9:38 AM
ÃÑSHÙ KHÁÑRÂ
ÃÑSHÙ KHÁÑRÂ - avatar