GATE IT 2005 · SQL Queries

MCQ · 1 mark · Problem DBMS-SQL-0132

In an inventory management system implemented at a trading corporation, there are several tables designed to hold all the information. Amongst these, the following two tables hold information on which items are supplied by which suppliers, and which warehouse keeps which items along with the stock-level of these items.Supply = (supplierid, itemcode)Inventory = (itemcode, warehouse, stocklevel)For a specific information required by the management, following SQL query has been writtenSelect distinct STMP.supplierid From Supply as STMP Where not unique (Select ITMP.supplierid
From Inventory, Supply as ITMP
Where STMP.supplierid = ITMP.supplierid
And ITMP.itemcode = Inventory.itemcode
And Inventory.warehouse = 'Nagpur');
For the warehouse at Nagpur, this query will find all suppliers wh
  1. A
    do not supply any item
  2. B
    supply exactly one item
  3. C
    supply one or more items
  4. D
    supply two or more items

Solve it on GATE DA practice →More Relational Model & SQL problems

Show the worked solutionOfficial GATE Answer Key: Option D.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/3832/gate2005-it-69

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com