Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write the correct SQL statements for the following situations: Isenberg School of Management, UMass Amherst ui For each product, calculate the number of orders and
Write the correct SQL statements for the following situations:
Isenberg School of Management, UMass Amherst ui For each product, calculate the number of orders and the total sales (standard price ordered quantity) Display product ID, product description, product line name and the calculated data if the ordered product is priced above $300 and the number of orders is greater than 2 . Sort the result set first by the number of orders in descending order and then by the total sales in descending order SELECT COUNT(Order_ID), SUM (Standard-Price"Ordered-Quantity) AS TotalSales FROM Order-Line-TAS ol, Product. TAS p WHERE AND Standard Price 300 GROUP BY HAVING ORDER BY ui . For each product finish, calculate the number of orders, the total sales, the total ordered quantity and the average ordered quantity Display the product finish, product line name and the calculated data if the average ordered quantity is greater than 2 and the total ordered quantity is greaterthan!5 Sort the result set by the product finish in alphabetical order . ui . For each customer state, calculate the total sales, the total ordered quantity and the largest ordered quantity Display the customer state and the calculated data, if the largest ordered quantity is above 3 and the product line name of an ordered product is Country Look or Scandinavia Sort the result set by the customer state in alphabetical order . Isenberg School of Management, UMass Amherst ui For each product, calculate the number of orders and the total sales (standard price ordered quantity) Display product ID, product description, product line name and the calculated data if the ordered product is priced above $300 and the number of orders is greater than 2 . Sort the result set first by the number of orders in descending order and then by the total sales in descending order SELECT COUNT(Order_ID), SUM (Standard-Price"Ordered-Quantity) AS TotalSales FROM Order-Line-TAS ol, Product. TAS p WHERE AND Standard Price 300 GROUP BY HAVING ORDER BY ui . For each product finish, calculate the number of orders, the total sales, the total ordered quantity and the average ordered quantity Display the product finish, product line name and the calculated data if the average ordered quantity is greater than 2 and the total ordered quantity is greaterthan!5 Sort the result set by the product finish in alphabetical order . ui . For each customer state, calculate the total sales, the total ordered quantity and the largest ordered quantity Display the customer state and the calculated data, if the largest ordered quantity is above 3 and the product line name of an ordered product is Country Look or Scandinavia Sort the result set by the customer state in alphabetical orderStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started