Explanation for what this code is doing 40 SELECT [EnglishCountry RegionName], FORMAT (SUM([OrderQuantity]), 'NO') as [Total] 41
Fantastic news! We've Found the answer you've been seeking!
Question:
Explanation for what this code is doing
Transcribed Image Text:
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] 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]
Expert Answer:
Answer rating: 100% (QA)
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 the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these databases questions
-
Q3. A study indicated that the productivity, as measured by quantity produced per hour, for an average worker who starts their shift at 8am is given by Q = -+3+6t2 + 24t. i. What is their...
-
Ayayai Company prepares its statement of cash flows using the direct method for operating activities. For the year ended December 31, 2024, Ayayai Company reports the following: Sales on account...
-
Using the data below, what is the standard deviation of mid stocks returns for the years 2016-2021? Year Mid stocks' return 2016 4.91% 2017 < 7.22% < 2018 -4.13% 2019 3.11% 2020 15.45% 2021 6.27%
-
Give examples of three exceptions to the Cardozo rule of foreseeability.
-
Find the current through section PQ of length a = 65.0 cm in Figure P31.11. The circuit is located in a magnetic field whose magnitude varies with time according to the expression B = (1.00 x 10-3...
-
For one of the following, determine the ratio of the fugacity in the Final slate to that in the initial state tor steam undergoing the isothermal change of stale: (a) From 9.000 kPu and 400C to 300...
-
Shades of Sand Spa Resort has 100 residential villas to accommodate guests. The accountant for the resort has asked you, the marketing manager, to prepare a budget for expected relaxation treatment...
-
1. What is Johnsons most pressing problem? Why? 2. What can Johnson do to help her team launch the new product within the six-week timeframe? Be specific? 3. Assume Johnson will select a new team to...
-
We had to read Leader-Member Exchange 'LMX' What Is It and Why You Should Care here:...
-
Refer to Figure 11.45. A square footing, 2 x 2 m in size, supports a column load of 300 kN. The soil characteristics are given in the figure. Field monitoring indicated that the foundation settlement...
-
The new president of an old, established company is facing a problem. The company is currently unprofitable and is, in the presidents opinion, operating inefficiently. The company sells a wide line...
-
Salty Ltd has two Cash Generating Units (CGU's) identified as the Sand CGU and the Sun CGU. The carrying amounts of the assets of the two CGU's at 30 June 20X1, were: Sand CGU 50,000 (10,000) Plant...
-
24. Assume that the resting heart rate in humans is normallydistributed with a population mean of 72 bpm and a standarddeviation of 8 bpm. a. What proportion of the population has resting heart...
-
Blossom Company manufactures and sells two products. Relevant per unit data concerning each product follow Product Basic Deluxe Selling price $41.0 $51.0 Variable costs $26.6 $28.6 Machine hours 0.4...
-
A single ion channel is selectively permeable to K+ and has a resistance of 2.30 GQ2. During an experiment, the channel is open for approximately 3.00 ms while the voltage across the channel is...
-
The figure below shows a rod of length 10 m positioned at steady state between two walls of constant temperatures To = 40C and Ts = 200C. The finite-difference representation of the problem employs...
-
Liz decides to calculate the descriptive statistics of Ireland's stock market in the most recent years. She wants to analyze only the last 3 years (2017-2019), Write the answer in percent format and...
-
Burberrys competitive advantage is through its differentiation strategy. What risk should Burberry remain aware of?
-
Kent Pham, CPA, is a 45-year-old single taxpayer living at 169 Trendie Street, La Jolla, CA 92037. His Social Security number is 865-68-9635. In 2012, Kent's W-2 as the controller of a local...
-
Indicate, in each of the following situations, the number of exemptions the taxpayers are entitled to claim on their 2012 income tax returns. Number of Exemptions a. Donna, a 20-year-old single...
-
Sophie is a single taxpayer. For the first payroll period in October 2012, she is paid wages of $3,250 monthly. Sophie claims three allowances on her Form W-4. a. Use the percentage method to...
-
The trial balance of Mumbai Co. at 31 December was as follows: The following information is applicable. (a) Inventory on 31 December is 850,000. (b) The cumulative allowance for doubtful debts is to...
-
The trial balance of Penang Co. on 31 July 20X7 was as follows. The following additional information is available: 1. Inventory at 31 July 20X6 is valued at 1,361,000. 2. Depreciation for the year is...
-
The trial balance of Shanghai Co. on 31 March 20X7 is given below. The following information is also relevant: 1. Closing inventory is valued at 133m. 2. Electricity accrued is estimated to be 5m. 3....
Study smarter with the SolutionInn App