select parts_0.pname, parts_0.color
from parts parts_0, catalogue catalogue_0, catalogue catalogue_1
where parts_0.pid = catalogue_0.pid and
parts_0.pid = catalogue_1.pid and
catalogue_0.pid = catalogue_1.pid and
catalogue_0.sid <> catalogue_1.sid
QUERY RESULT IS:
| PNAME | COLOR |
|---|---|
| nut | red |
| bolt | green |
| screw | red |