Fall_Final03Solutions - CSE 412/598 Database Management...

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

View Full Document Right Arrow Icon
CSE 412/598 Database Management Systems Final Exam Fall 2003 NAME_________________________ASUID____________________ CLASS_____________ [30 pts.] 1. Express the following queries in relational algebra and in DRC . Suppliers (sid , sname, address). Parts (pid , pname, color). Catalog (sid , pid , cost). a) Find the snames of suppliers who supply some red part. Relational Algebra: Project = П Select = σ Natural Join = П sname [ [ (П sid, pid Catalog) (П pid(σ color=’red’ Parts))] (П sname, sid Suppliers)] DRC {sname | (exists pid, sid) (Parts(pid, _, ‘Red’) and Catalog(sid, pid,_ ) and Suppliers(sid, sname, _ ))}; b) Find the sids of suppliers who supply every red part. Relational Algebra: redParts := П pid (σ color=’red’ Parts); П sids [(П sid, pid Catalog) ٪ redParts] DRC: redParts := { pid | (Parts(pid, _ , ‘red’))}; { sid | Suppliers(sid, _, _ ) and not (exists pid) (redParts(pid)) and not Catalog(sid, pid, _ ))};
Background image of page 1

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

View Full DocumentRight Arrow Icon
c) Find the pairs of sids such that the supplier with the first sid charges more for some part
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/12/2010 for the course CSE 41412 taught by Professor Hassan during the Fall '10 term at University of Arizona- Tucson.

Page1 / 6

Fall_Final03Solutions - CSE 412/598 Database Management...

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

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