Question: Explanation for what this code is doing 40 SELECT [EnglishCountry RegionName], FORMAT (SUM([OrderQuantity]), 'NO') as [Total] 41 FORMAT (SUM([OrderQuantity]/@decAllUnits), 'P2') as [ % Total] 42

 Explanation for what this code is doing

40 SELECT [EnglishCountry RegionName], FORMAT(SUM([OrderQuantity]), 'N0') as [Total] SELECT DISTINCT ( [ModelName]), [DealerPrice] FROM [dbo]. [DimProduct] WHERE [ProductSubcategoryKey] IN 

40 SELECT [EnglishCountry RegionName], FORMAT (SUM([OrderQuantity]), 'NO') as [Total] 41 FORMAT (SUM([OrderQuantity]/@decAllUnits), 'P2') as [ % Total] 42 CASE > 43 44 45 46 47 48 49 50 51 52 FROM [dbo]. [DimReseller] as r 53 INNER JOIN [dbo].[FactResellerSales] as s ON s. [ResellerKey] = r. [Resellerkey] INNER JOIN [dbo]. [DimGeography] as g ON g. [GeographyKey] = r. [GeographyKey] 55 GROUP BY [EnglishCountry RegionName] 54 > WHEN [EnglishCountry RegionName] IN ('France', 'Germany', 'United Kingdom') THEN FORMAT (SUM([OrderQuantity]/@decEuropeUnits), 'P2') WHEN [EnglishCountry RegionName] IN ('Canada', 'United States') THEN FORMAT (SUM( [OrderQuantity]/@decNorth AmericaUnits), 'P2') WHEN [EnglishCountry Region Name] ='Australia' Then '100%' END as [% Region Total]

Step by Step Solution

3.43 Rating (159 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The code youve provided consists of two distinct SQL queries each performing different operations on data within a database Lets break down each query ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!