1

I have the following tables:

Suppliers(Sno, Sname, Address)
Parts(Pno, Pname, Colour)
Catalogue(Sno, Pno, Price)

I want to find the name of all suppliers who is supplying all the parts of a particular color say "BLUE"?

I want to solve it using logical operators like AND, OR, NOT etc and select, project or join operations.

Bernhard Barker
  • 54,589
  • 14
  • 104
  • 138
Sanjeev
  • 221
  • 1
  • 4
  • 8

1 Answers1

1

Try this:

SELECT *
FROM    Catalogue AS C
        INNER JOIN Parts AS P
            ON C.Pno = P.Pno
        INNER JOIN Suppliers AS S
            ON C.Sno = S.Sno
WHERE   P.Color = 'Blue'

Hope it helps.

Horia
  • 1,612
  • 11
  • 18