Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a query to retrieve the customerID, orderid, order date, shipping cost and shipping date of orders if the shipping date is between April 3,

  1. Create a query to retrieve the customerID, orderid, order date, shipping cost and shipping date of orders if the shipping date is between April 3, 2014 and July 5, 2015 and shipping cost is greater than or equal to 40. 

2. Create a query to retrieve first name, last name, and zip of the customers where the first digit of zip code is 1 or 3 and the last digit is any number between 3 and 7. Zip code is 5 digits code. 

3. Create a query to retrieve ShipperID and the total shipping cost by ShipperID named as"TotalShippingCost" for all orders in the Orders table. 

4. Create a query to retrieve all products whose unit price is above the average unit price. The SQL query should use Subquery that shows product name and product unit price from Products table. Order the output by the product unit price, largest first (descending order). The query output should be like the following table.


 

Create a query to retrieve the number of customers who had orders after March 17, 2015 (including this date) in each state. The SQL query should use Subquery to show the number of customers (named "total_customer") by state. The query output should be like the following table. 


 

 Create a query to retrieve a list of product inventory quantities and their respective supplier. The query should include company name of supplier (from Suppliers table), product name, units in stock, and units on order (from Products table). Sort the results alphabetically by company name. The query output should be like the following table. 


 

Create a query to retrieve all products and each product's total quantity of orders. The SQL query should show the product name (from Products table) and the total quantity of orders (quantity column from Productsorders table) for each product (named "TotalOrders"). Order the output by the TotalOrders, largest first. The query output should be like the following table. 


 

Create a query to retrieve all products that had been ordered by customer id = 2. The SQL query should show order id, order date (from Orders table) , product ID, and product name (from Products table). Sort the results by orderdate with ascending order so that the older appear first. The query output should be like the following table. 


 

Coffee biscuits Pepper Cheese Box 3.75 oz. Pizza croutons productname Chocolate Chip Cookies Fruit Dip Chocolate Chunk Cookies, 9.5 oz. Lemon Biscuits Mushroom Rolls Dark Chocolate Apricots in 20 oz. Bag productunitprice Y 50 50 49 49 49 48 48 48 46

Step by Step Solution

There are 3 Steps involved in it

Step: 1

1 Query to retrieve the customerID orderid order date shipping cost and shipping date of orders if the shipping date is between April 3 2014 and July 5 2015 and shipping cost is greater than or equal ... 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

Auditing The Art and Science of Assurance Engagements

Authors: Alvin A. Arens, Randal J. Elder, Mark S. Beasley, Joanne C. Jones

13th Canadian edition

133405508, 978-0133405507

More Books

Students also viewed these Databases questions