Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started