Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
1.0 kB
1
Indexable
Never
-- A: Find the names of all suppliers who have not supplied only blue parts.
--
--a.
--Find the names of all suppliers who have not supplied only blue parts.
--
--
--b.
--Find the names of all suppliers who have supplied only blue parts.
--
--
--c.
--Find the names of all suppliers who have not supplied a non-blue part.
--
--
--d.
--Find the names of all suppliers who have supplied a non-blue part.
--
--
--e.
--None of the given options is correct
--

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'))
                                                
Suppliers(sid:integer, sname:string, city:string, street:string)
Parts(pid:integer, pname:string, color:string)
Catalog(sid:integer, pid:integer, cost:real)
Leave a Comment