The GATE Grind

GATE 2009 CS – Question 55

Databases · Relational Model: Relational Algebra, Tuple Calculus, SQL · 2 marks · Multiple choice

Relations: Suppliers(sid:integer, sname:string, city:string, street:string), Parts(pid:integer, pname:string, color:string), Catalog(sid:integer, pid:integer, cost:real). Primary keys are sid for Suppliers, pid for Parts, and (sid, pid) for Catalog. Assume the relations are nonempty. What does this query mean?

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'))
  1. Names of suppliers who supplied a non-blue part.
  2. Names of suppliers who have not supplied a non-blue part.
  3. Names of suppliers who supplied only blue parts.
  4. Names of suppliers who have not supplied only blue parts.

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (D) Names of suppliers who have not supplied only blue parts.

Explanation

We are sorry we couldn't write detailed soluition for this, we are working on it!, please consider asking your own AI, its just 2-3 clicks with very minimum effort

More Relational Model: Relational Algebra, Tuple Calculus, SQL questions

All Relational Model: Relational Algebra, Tuple Calculus, SQL questions →