Answered step by step
Verified Expert Solution
Link Copied!

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)

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Has the team bought in?

Answered: 1 week ago

Question

Identify the elements that make up the employee reward package.

Answered: 1 week ago

Question

What are the functions of top management?

Answered: 1 week ago

Question

Bring out the limitations of planning.

Answered: 1 week ago

Question

Why should a business be socially responsible?

Answered: 1 week ago

Question

Discuss the general principles of management given by Henri Fayol

Answered: 1 week ago

Question

2. What should an employer do when facing an OSHA inspection?

Answered: 1 week ago