{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Fall_Final03Solutions

# Fall_Final03Solutions - CSE 412/598 Database Management...

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

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, _ ))};

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

View Full Document
c) Find the pairs of sids such that the supplier with the first sid charges more for some part
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### 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
Ask a homework question - tutors are online