Ok... Given:
Suppliers(SN, sname, status, city)
Parts(PN, pname, color, weight, city)
Projects(JN, jname, city)
Shipments(SN, PN, JN, qty)
(Keys are in Caps)
Quesitons:
Get Supplier numbers for suppliers supplying some project with part 'p2' in a quantity greater than the average shipment quantity of part 'p2' for that project.
I have an answer for this one but I think it's wrong:
select SN
from shipments s
where s.PN='p2'
and s.qty > (select AVG(s.qty)
from shipments s1, projects p,
where s1.jn=p.jn)
I also need answers to three other questions and I have no idea how to do them....
Get supplier numbers for suppliers who supply the same part to all projects
and
Get project numbers for projects supplied entierly by supplier 's1'
and
Get the total Quantity of part 'p1' supplied by supplier 's1'
(I think the answer for this one is:
select qty
from shipments
where pn=p1 and
sn=s1
Please help!

Suppliers(SN, sname, status, city)
Parts(PN, pname, color, weight, city)
Projects(JN, jname, city)
Shipments(SN, PN, JN, qty)
(Keys are in Caps)
Quesitons:
Get Supplier numbers for suppliers supplying some project with part 'p2' in a quantity greater than the average shipment quantity of part 'p2' for that project.
I have an answer for this one but I think it's wrong:
select SN
from shipments s
where s.PN='p2'
and s.qty > (select AVG(s.qty)
from shipments s1, projects p,
where s1.jn=p.jn)
I also need answers to three other questions and I have no idea how to do them....
Get supplier numbers for suppliers who supply the same part to all projects
and
Get project numbers for projects supplied entierly by supplier 's1'
and
Get the total Quantity of part 'p1' supplied by supplier 's1'
(I think the answer for this one is:
select qty
from shipments
where pn=p1 and
sn=s1
Please help!
