Question: For this assignment, we will be using the following relational schema for our queries. Customer(CID, Name, Address) Orders(Ordernum, CID, Order_date, Cardnum) Orderlist(Ordernum, ISBN, Qty, Ship_date)

For this assignment, we will be using the following relational schema for our queries.

Customer(CID, Name, Address)

Orders(Ordernum, CID, Order_date, Cardnum)

Orderlist(Ordernum, ISBN, Qty, Ship_date)

Book(ISBN, Title, Author, Qty_in_stock, Price)

When an order is placed, there is one entry added to Orders which contains the customer information and order details. Then there is one entry per book entered into Orderlist with "NULL" in the ship date which will be replaced once that line item has been shipped. Each book item will only be shipped when all the copies are present (ie: we have sufficient Qty_in_stock for the Qty of the order, that way there is a unique ship_date for each line item). Note: you can also take advantage of renaming (RA) and views (SQL) to break down some of the queries into smaller parts.

Determine the SQL Queries

8. Write a query which will list the order number and the total cost of the back-ordered books, for any order which is not fully shipped.

10. Write a query to generate a list of customer names and book titles of the customers who currently have a book on back order which was previously shipped on a different order.

11. Write a query which will list the ISBN and title of book which has sold the most copies in the history of our book store.

12. Write a query which will list the customer name, order number and total value for any order which had more than 10 books ordered on it.

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!