I need help with an SQL query with the following questions What are the top 10 o
ID: 3585668 • Letter: I
Question
I need help with an SQL query with the following questions
What are the top 10 orders according to quantity?
What were the top 10 orders according to final cost? (quantity x unit cost)
How many regions do each employee work?
What was the average time from order to shipping for each employee? (shipping Date - order date)
I think these are all the tables related to the questions
The tables are attached:
Explanation / Answer
Top 10 orders according to quantity
1- SELECT * FROM Products
ORDER BY UnitsOnOrder DESC
LIMIT 10;
2- top 10 orders according to the final cost-
insert into Products select QuantityPerUnit*UnitPrice as TotalSales from Products;
SELECT * FROM Products
ORDER BY TotalSales DESC
LIMIT 10;
3-Select COUNT(TerritoryID) as [Number of regions],EmployeeID
FROM employeeterritories
group by EmployeeID;
4- no table provided for order date and shipping date .
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.