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

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

View Full Document Right Arrow Icon
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.
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/17/2012 for the course CS 411 taught by Professor Winslett during the Spring '07 term at University of Illinois at Urbana–Champaign.

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 Right Arrow Icon
Ask a homework question - tutors are online