Question: Using SQL language. Please focus on those questions first: 2, 6, 7, 9, 10, 14, and 15. Don't forget to include the query statement and



Using SQL language. Please focus on those questions first: 2, 6, 7, 9, 10, 14, and 15.
Don't forget to include the query statement and the query result.
BOOKS PUBLISHI PubID INT(2) Name VARCHAR(23) Contad VARCHAR(15) Phone VARCHAR(12) Title V PubDate DAT PROMOTION Gift VARCHAR(15) Minretail DECIMAL (5,2) Maxretail DECIMAL(5,2) Cost DECIMAL(5,2) Retail DECIMAL (5,2) Discount DECIMAL(4,2) Category VARCHAR( 12) Indexes Indexes BOOKAUTHC D VARCHAR(4) ORDERS Order_num INT(4) Customer OrderDate DATE Indexes ShipDate DATE ORDERITE ShipStreet VARCHAR(18) AUTHOR INT ShipCity VARCHAR(15) ShipState VARCHAR(2) ShipZip VARCHAR(5) ShipCost DECIMAL(4,2) Item_num INT(2) Lame VARCHAR(10) Fname VARCHAR( 10) Quantity INT(3) Indexes PaidEach DECIMAL(5,2) Indexes Indexes CUSTOMERS INT LastName VARCHAR(10) FirstName VARCHAR(10) Address VARCHAR(20) City VARCHAR(12) State VARCHAR(2) Zip VARCHAR(5) Referred INT(4) Region CHAR(2) Indexes Use database YourUsername_3 to complete the following queries in SL. Please include both the query statements and the query results in your submission. Section 1: Multiple-table Queries Determine which orders haven't yet shipped and the name of the customer who placed the order. Sort the results by the date on which the order was placed. List the order number, the corresponding customer name, and order date 1. Find a list of all customers who live in the state of FL and have ordered books about COMPUTERs (ie, category = 'COMPUTER'). List the customer number, the customer name, and the corresponding order number 2. Determine which books customer JAKE LUCAS has purchased. If he has purchased multiple copies of the same book, unduplicate the results. List the book title. 3. Determine the profit of each book sold to JAKE LUCAS, using the actual price the customer paid (profit- PaidEach - Cost). Sort the results by order date first. If more than one book was ordered on the same day, sort the results by profit amount irn descending order. List the book title, the order date, and the corresponding profit. 4. Determine which books were written by an author of last name ADAMS? List the isbn and the title of the book. 5. 6. Identify the authors of the books BECCA NELSON ordered. List the name of the author and the book title. 7. Display a list of all books. If a book has been ordered by a customer, list the boo title, and the corresponding order number and the state in which the customer resides. If a book has not been ordered by a customer, only list the book title. Section 2: Aggregate Functions 8. Find the number of books which have a retail price of $30.00 or more. 9. Display the most recent publication date among all books owned by the bookstore. 10. Determine the total profit generated by sales to customer 1017. [Note: total profit- sum((retail-cost)*quantity)] 11. List the retail price of the least expensive book in the CHILDREN category. 12. Determine how many orders have been placed by each customer. Do not include the customers who haven't placed any order. Display the customer number, and the number of orders placed by the customer. 13. Determine the average retail price of books by publisher and category (i.e., group by publisher name and book category). Include only the (publisher, category) pair when the corresponding average retail price is more than $50 14. List the customers living in GA or FL who have placed an order totaling more than $80 (hint: use "group by order_num having "). List the name of the customer, the order number, and the corresponding order total. Sort the result by the order total in ascending order. [Note: Order total-sum(retail*quantity)]. 15. What's the retail price of the most expensive book written by LISA WHITE
Step by Step Solution
There are 3 Steps involved in it
Query Responses 2 Find a list of all customers who live in the state of FL and have ordered books about COMPUTERs ie category COMPUTER List the custom... View full answer
Get step-by-step solutions from verified subject matter experts
