Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the relations: Customer(CustID, Name, City, State), Order(BID, CustID, Date), and Product(PID, ProductName, Price) LineItem(LID, BID,PID, Number, TotalPrice), where CustID is a customer id and

Consider the relations: Customer(CustID, Name, City, State), Order(BID, CustID, Date), and Product(PID, ProductName, Price) LineItem(LID, BID,PID, Number, TotalPrice), where CustID is a customer id and is a key for Customer, BID is an order id and is a key for Order, and LID is a line item id and is a key for LineItem. In addition the attribute CustID of Order is a foreign key referring to the CustID of Customer, that is, for each CustID c of Order there is exactly one tuple of Customer whose CustID attribute is c. The BID of LineItem is a foreign key referring to the BID of Order. There are several line items for the same order, a line item refers to a product and contains the quantity ordered for the product.

Express the following queries Algebra:

1. List the other products bought by customers who bought computers

2. List the products bought by all the customers of San Diego

3. List the products never ordered by customers of California

4. List the products ordered only by the customers of San Diego

5. List the customers who ordered computers

6. List the products bought by at least one customer of San Diego

7. List the customers who did not place any order since May 15 2011

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: 3

blur-text-image

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

Advances In Databases And Information Systems 22nd European Conference Adbis 2018 Budapest Hungary September 2 5 2018 Proceedings Lncs 11019

Authors: Andras Benczur ,Bernhard Thalheim ,Tomas Horvath

1st Edition

3319983970, 978-3319983974

More Books

Students also viewed these Databases questions