Given,
Suppliers(sid,sname,rating)
Parts(pid,pname,color)
Catalog(sid,pid,cost)
1.Retrieve sid of the suppliers who supplied some red or some green part.
I did it this way- {t | ∃c∊Catalog ∃p∊ Parts(c.pid=p.pid ∧ p.color="Red" ∨ p.color="Green" ∧ t.sid=c.sid)}
1 more way to do-- {t | ∃c∊Catalog (∃p∊ Parts( p.color="Red" ∨ p.color="Green"∧ c.pid=p.pid) ∧ t.sid=c.sid)}
I want to verify whether these TRC queries are correct or not.Also correct me if i am wrong.
Suggest some other ways if possible.
Also,
2. Retrieve sid of suppliers who supplied at least two parts.