Question: 7. (5 points) Write a query to retrieve the number of customers who had orders after March 17, 2015 (including this date) in each

7. (5 points) Write 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. Save your query as "Qry7" in Practice Database.accdb. AZ CA co companyame American Foods, LLC. American Foods, LLC. American Foods, LLC. American Foods, LLC. American Foods, LLC. American Foods, LLC. American Foods, LLC. American Foods, LLC. American Foods, LLC. American Imports Inc American imports Inc. American imports inc American imports inc DC FL State MA NY OH PA IX productname total customer Cappuccino Almonds in Boz. Bag Chocolate Covered Cherries in 8 oz. Bag Chocolate Blueberries in 10 oz. Bag Chocolate Fudge Chocolate Blueberries in 10 oz. Bag Chocolate Almonds in & oz. Bag Derk Chocolate Apricots in 20 oz. lag Sesame Crackers in 20 oz. Pack Crispy Pears Water Crackers 4.4 oz. Nacho Chips Bag Roasted No-Salt Almonds Roasted & Salted Cashews 12 43 11 12 19 11 27 14 8. (10 Points) Write 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. Save your query as "Qry8" in PracticeDatabase.accdb. 5 24 unitsinstock. unitsonorder ======= 32 42 39 31 28 21 30 43 31 44 24 38 22 0 0 0 OORRA 25 10 15 9. (10 Points) Write 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. Save your query as "Qry9" in Practice Database.accdb.
Step by Step Solution
There are 3 Steps involved in it
7 SELECT State COUNT Customer ID AS total customer F... View full answer
Get step-by-step solutions from verified subject matter experts
