MySQL, which you seem to be using, does not support the INTERSECT syntax. You will have to solve it differently.
In this case, this is trivial - we only need a list of all suppiers that offer the "green" and "red" parts of any part - your request does not worry about whether the parts are connected, so we can solve this quite easily:
SELECT Suppliers.sid FROM Suppliers JOIN Catalog ON Catalog.sid = Suppliers.sid JOIN Parts ON Parts.pid = Catalog.pid WHERE Parts.color IN ('red', 'green') GROUP BY Suppliers.sid HAVING COUNT(DISTINCT Parts.color) = 2
Personally, I don't think the original query is a typical INTERSECT problem. Take a look at the JOIN solution offered by Vinko Vrsalovic for the generic INTERSECT emulation INTERSECT (which I would prefer even if the DBMS really offers INTERSECT initially)
Rolling bouman
source share