hw2[1] - 1. (30 points) Express in relational algebra the...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE 5330: Database Systems I Fall 2001 Homework #2 Due on Monday, October 1st, at beginning of class. Worth 3% of the final grade Answer Key Suppose we have a database consisting of the following four relations: serves(restaurant,meal,price) (what meals each restaurant serves) likes(patron,meal,rating) (which meals each patron likes to eat) located-at(restaurant,addr) (the restaurant location) frequents(patron,restaurant) (the restaurants each patron visits) The ``rating'' a patron gives to a meal is a real number reflecting the degree of approval of that meal; the price charged by a restaurant for a serving of meal is another real number. Assume each patron likes at least one meal and frequents at least one restaurant. You may also assume that are no duplicates in relation "likes".
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1. (30 points) Express in relational algebra the following queries: 1. find the restaurants that serve a meal that patron John Doe likes; 2. find the meals served at restaurants that patron John Doe frequents; 3. find the patrons that frequent at least one restaurant that serves a meal they like; 4. find the patrons that like at least three different meals. 5. find all patrons that frequent a restaurant that serves a meal that John Doe likes 2. (40 points) Exercise 7.24 from the textbook. 3. (30 points) Exercise 7.27 from the textbook. Y. Alp Aslandogan 2001-09-24...
View Full Document

Ask a homework question - tutors are online