Back at work on Monday morning, the Vice President of Purchasing asks you to help him with the analysis of in-process storage. He asks you to pull information regarding the number of products per storage location.
The result of the query should show: - The name of the warehouse (Location) - The number of different products per storage location - The total quantity of products found at this storage location - The average price of all products found at this storage location
He mentions that for the moment he is only interested in the locations that have more than 50 distinct products because he wants to start inventorying the biggest locations first.
Show the locations in order of smallest to largest number of distinct products.
My request is linked to the question but i'm having trouble executing it I would love to know how to do it, thanks in advance.
Transcribed Image Text:Quick Launch (Ctrl+Q)
- H2022 TP2.sql - TABLET-LT5IG6DB\SQLEXPRESS.AdventureWorks2019 (TABLET-LT5IG6DB\AHLEM YASMINE (52)) - Microsoft SQL Server Management Studio
Edit
View
Query
Project
Tools
Window
Help
E New Query
品
品中命|2.
MDX'
DMX'
XMLA DAX
ロロ
* AdventureWorks2019
> Execute
bject Explorer
H2022_TP2.sql - T...HLEM YASMINE (52)) + X
=>Question 2
De retour au travail lundi matin, le vice-président des achats vous demande de faire l'aider avec l'analyze de 1'entreposage des produits en cours de production.
Il vous demande de sortir des informations concernant le nombre de produits par localisation d'entreposage.
Le résultat de la requête doit présenter :
- Le nom de l'entreposage (Location)
Le nombre de produits différents par localisation d'entreposage
La quantité totale de produits retrouvés à cette localisation d'entreposage
Le prix moyen de tous les produits retrouvés à cette localisation d'entreposage.
Il vous mentionne que pour l'instant il est interessé uniquement par les localisations qui ont plus de 50 produits distincts car il veut commencer à faire l'inventaires
des plus grosses localisations en premier.
Montrez les localisations par ordre du plus petit au plus grands nombre de produits distincts.
*/
ESELECT Production. Location.Name,
Production.ProductInventory. LocationID,
COUNT (DISTINCT ProductID), SUM (ProductID), AVG (StandardCost) FROM Production.Product
LEFT JOIN Production.ProductInventory ON Production. ProductInventory.ProductID
LEFT JOIN Production.Location ON Production. Location. LocationID
%3D
Production. Product.ProductID
Production. ProductInventory. LocationID;
90 %
BT Messages
Msg 209, Level 16, State 1, Line 99
Ambiguous column name 'ProductID'.
Msg 209, Level 16, State 1, Line 99
Ambiguous column name 'ProductID'.
Completion time: 2022-02-20T17:10:24.0675769-05:00
90 %
Query completed with errors.
TABLET-LT5IG6DB\SQLEXPRESS . TABLET-LT5IG6DB\AHLEM .. AdventureWorks2019 00:00:
OReady
Ln 97
Col 1
Ch 1
INS
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.