ISRO Computer Science (CSE) 2015 - Question 22

All ISRO Computer Science (CSE) papers | ISRO Computer Science (CSE) 2015

Consider the following relational query... SELECT S.name 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')). The query returns:

  • A. Find the names of all suppliers who have supplied non-blue part.
  • B. Find the names of all suppliers who have not supplied non-blue part.
  • C. Find the names of all suppliers who have supplied only non-blue parts.
  • D. Find the names of all suppliers who have not supplied any blue part.

Answer: A. Find the names of all suppliers who have supplied non-blue part.

Explanation: Innermost: PIDs of parts that are NOT blue (i.e. other colors). Middle: SIDs who supply parts NOT in the non-blue set (i.e. supply ONLY Blue parts). Outer: Suppliers NOT in the 'Only Blue' list. This effectively gives Suppliers who supply at least one Non-Blue part.

| | All questions of ISRO Computer Science (CSE) 2015