+ 1

MULTIPLE TABLES IN SQL

How to write sql query for the following: Distributor (Dno, Dname, Daddress, Dphone) Item (Itemno, Itemname, Colour, Weight), Dist_Item(Dno, Itemno, Qty) a. Find out distributors, who have supplied item number 01. b. Find out details of item supplied by distributor 01.

12th Sep 2018, 12:19 AM
harshit
harshit - avatar
2 Réponses
+ 3
a. SELECT Item.Itemno, Distributor.Dname, Distributor.Dno from Dist_Item JOIN Distributor on Distributor.Dno = Dist_Item.Dno JOIN Item on Distributor.Itemno = Dist_Item.Itemno WHERE Dist_Item.Itemno = '1'; b. SELECT Distributor.Dno, Item.Itemno, Item.Itemname, Item.Colour, Item.Weight from Dist_Item JOIN Distributor on Distributor.Dno = Dist_Item.Dno JOIN Item on Item.Itemno = Dist_Item.Itemno WHERE Dist_Item.Dno = '1';
12th Sep 2018, 4:40 AM
Email Not Activated
12th Sep 2018, 2:03 AM
Alexander Santos
Alexander Santos - avatar