Professional Documents
Culture Documents
Question Format
(1) R1∪R2
(2) R1∩R2
(3) R1−R2
(4) R1×R2
(5) σa=5(R1)
(6) πa(R1)
Suppliers(sid, sname, address)
Parts(pid, pname, color)
Catalog(sid, pid, cost) sid FK Supplies, pid FK Parts
• Write query that finds all suppliers (sid) who supply some red part.
• Write a query that finds all suppliers (sname) who only supply red
parts.
Suppliers(sid, sname, address)
Parts(pid, pname, color)
Catalog(sid, pid, cost) sid FK Supplies, pid FK Parts
• How large or small could the result of a query that finds all suppliers
(sid) who supply some red part be?
Suppliers(sid, sname, address)
Parts(pid, pname, color)
Catalog(sid, pid, cost) sid FK Supplies, pid FK Parts
• Write SQL query that finds the supplier who supplies the most
expensive widget (pname = widget).