What will be the correct output of this query | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What will be the correct output of this query

Consider the following relational schema Suppliers(sid:integer, sname:string, city:string, street:string) Parts(pid:integer, pname:string, color:string) Catalog(sid:integer, pid:integer, cost:real) Consider the following relation query for the above database Select S.sname From Suppliers S Where S.sid NOT in (select C.sid from Catalog C where C.pid not in (Select p.pid from Parts P where P.color<>'blue')) Is it correct query for getting the name of supplier who have supplied a non blue part or it is returning something else

6th Sep 2019, 5:07 AM
Preity
Preity - avatar
1 Answer
+ 3
Preity Considering it's nearly 3am EDT, I may not be thinking most clearly... But your query seems to make sense and at first glance should work. Have you attempted using outer joins and filtering on null matches instead? That's the approach I would have gone.
6th Sep 2019, 6:53 AM
David Carroll
David Carroll - avatar