Pid Color Red' Sid Name
Pid Color Red' Sid Name
R1 = pid(color = redparts)
Step 2 :
R2 = sid(R1 $ Catalog )
Step 3 :
R3=name(R2 $ Sppliers)
Required answer is R3
2) Find the sids of suppliers who supply some red or green parts
Step1:
Step 2 :
R2 = sid(R1 $ Catalog)
Same as above one but here we have to choose red or green parts and we have
to have sids of suppliers so we can stop after step 2 after choosing parts either
in red color or green color
3) Find the sids of suppliers who supply some red part or are at 221 packer Ave
Sids of suppliers who supply some red part
Step 1 : R1 = pid(color = redparts)
Step 2 :
R2 = sid(R1 $ Catalog )
4) Find the sids of suppliers who supply some red part and some green part
A) R1 = sid(pid(color = red parts) $ Catalog)
R2 = sid(pid(color = greenparts) $ Catalog)
From question one we get the sids of suppliers who supply some red part (R1)
Similarly R2 is the sids of suppliers who supply some green part
Required list of sids who supply some red and some green part is R1
Intersection R2
7)Find the sids of suppliers who supply every red or green part
A) R1= sid,pid Catalog
R2=pidcolr=red v green parts
R1/R2 gives the sids of suppliers who supply every part which is either red in
Color or green in color