|
|
R1 = σcity = 'Atl' ( project ) R2 = σcolor = 'red' ( part ) R3 = R1 ⋈ spj ⋈ R2 // R3 = suppliers who supplies a red part to a proj in Atl Ans = πsname ( R3 ⋈ supplier ) |
R1 = σcity = 'Atl' ( project ) R2 = σcolor = 'red' ( part ) R3 = R1 ⋈ spj ⋈ R2 // R3 = suppliers who supplies a red part to a proj in Atl R4 = snum F count(jnum) ( R3 ) R5 = σcount >= 4 ( R4 ) Ans = πsname ( R5 ⋈ supplier ) |
R1 = σcity = 'Atl' ( project ) R2 = R1 ⋈ spj // R2 = suppliers who supplies to a proj in Atl R3 = πsnum ( supplier ) − πsnum ( R2 ) Ans = πsname ( R4 ⋈ supplier ) |
The answer has the following form:
sname pname total shipped ---------- ---------- --------------------------------- Adams Bolt 300 Adams Cam 1000 Blake Screw 700 Bond Cam 100 ... |
R1 = snum,pnum F sum(qty) ( spj ) Ans = πsname, pname ( supplier ⋈ R1 ⋈ part ) |
R1 = snum F count(jnum,pnum,qyt) ( spj ) R2 = F count(jnum,pnum,qyt) ( spj ⋈ σsname='Newton' (supplier) ) R3 = R1 ⋈ count > count R2 Ans = π sname R3 ⋈ supplier |