assign4back

assign4back - #Assign4.sql by Roman Bykhovoy #1 select...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 #Assign4.sql by Roman Bykhovoy #1 select distinct P.pname from parts P, catalog C where P.pid=C.pid #2 select S.sname from suppliers S where NOT EXISTS ( select P.pid from parts P where NOT EXISTS ( select C.pid from catalog C where C.pid = P.pid AND C.sid = S.sid)) #3 select S.sname from suppliers S where NOT EXISTS ( select P.pid from parts P where P.color = 'Red' AND NOT EXISTS ( select C.pid from catalog C where C.pid = P.pid AND C.sid = S.sid)) #4 select p.pname from parts p, catalog c, suppliers s where p.pid = c.pid and c.sid = s.sid AND s.sname = 'Acme Widget Suppliers' AND not exists ( select * from catalog c1, suppliers s1 where p.pid = c1.pid and c1.sid = s1.sid AND s1.sname <> 'Acme Widget Suppliers') #5 select distinct C.sid from catalog C where C.cost > ( select AVG(C1.cost) from catalog C1 where C1.pid = C.pid ) #6 select P.pid, S.sname
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Sheet1 Page 2 from parts P, suppliers S, catalog C where C.pid = P.pid and C.sid = S.sid AND C.cost = (select max(C1.cost)
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

assign4back - #Assign4.sql by Roman Bykhovoy #1 select...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online