{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Tutorial2 - sol

Tutorial2 - sol - Tutorial 2 Problem 1 Consider the...

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

Tutorial 2 Problem 1: Consider the following relations: Suppliers(sid, sname, address) Parts(pid, pname, color) Catalog(sid, pid, cost) Give the queries in relational algebra to answer the following questions. You should use only the basic operators plus join: (set union ‘U’, set difference ‘-‘, selection ‘ σ ’, projection ‘ π ’, renaming ‘ ρ ’, and join ‘|><|’ (for natural join you can also just write ‘JOIN’)). 1. Find the sid of all suppliers who supply green parts. 2. Find the sid of all suppliers who supply only green parts. 3. Find the sname of suppliers who supply some green part but are NOT at "201 N. Goodwin Ave.". 4. Find the sname of suppliers who don't supply any part that is more expensive than \$50. Solution 1. π _[sid] ( σ _[color='green'] (Parts JOIN Catalog)) 2. The easiest way to solve these types of questions in relational algebra is to find the complement relation and then compute its difference from the original relation.

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 3

Tutorial2 - sol - Tutorial 2 Problem 1 Consider the...

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

View Full Document
Ask a homework question - tutors are online