14.0k views
0 votes
1. Write a query to list the names all products (by product code and name) and the average ordered quantity for each product with a product name that starts with 198 (if the product has never been ordered, then only show the product code and name). Order the result by ascending order of average ordered quantity.

1 Answer

6 votes

select WorkCenterId, Count (ProducedIn_t.ProductID) as 'TotalProducts' from ProducedIn_t left outer join Product_t on Product_t.ProductID=Product_t.ProductID group by WorkCenterId

User Shaun Han
by
6.4k points