Question: 4. Consider the following relational database schema discussed in class, where the pri- mary key of each relation is underlined. Pizzas (pizza) Customers cname, area)

 4. Consider the following relational database schema discussed in class, where

4. Consider the following relational database schema discussed in class, where the pri- mary key of each relation is underlined. Pizzas (pizza) Customers cname, area) Restaurants (rname, area) Contains (pizza, ingredient) Sells (rname, pizza, price) Likes cname, pizza Pizzas indicates all the pizzas of interest. Customers indicates the name and location of each customer. Restaurants indicates the name and location of each restaurant. Contains indicates the ingredients used in each pizza. Sells indicates the pizzas sold by restaurants and their prices. Likes indicates the pizzas that customers like. The following are all the foreign key constraints on the database schema: Contains.pizza is a foreign key that refers to Pizzas.pizza. Sells.rname is a foreign key that refers to Restaurants.rname. . Sells.pizza is a foreign key that refers to Pizzas.pizza. Likes.cname is a foreign key that refers to Customers.cname. Likes.pizza is a foreign key that refers to Pizzas.pizza. Answer each of the following queries using relational algebra. (a) Find pizzas that Alice likes but Bob does not like. (b) Find all customer-restaurant pairs (CR) where C and R are both located in the same area, and C likes some pizza that is sold by R. (c) Find all customer-pizza pairs (CP) where C does not like P. () Find all customer pairs (C1, C2) where C1 likes some pizza that C2 does not like. (e) Find all customer pairs (C1, C2) where C1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!