Question: Write Using PostGre SQL. Please explain as much as you can. Thank you. Part 2 : The queries in this section will be based on

Write Using PostGre SQL. Please explain as much as you can. Thank you.

Part 2:

The queries in this section will be based on the following relational schema:

Customer(CID, Name, Address, Phone)

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).

11. Write a SQL query which will list the ISBN, Author, Title and total number of copies ordered, for every Book in our catalogue (even if there were no copies ordered). // Write without COALESCE function

13. Write a SQL query which will list the CID and name of all the customers who have ordered every book with a title begining with Star Wars and that we have in stock.

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!