+ INNER JOINS: Join three tables: Using the Order Details, OrderHeaders, and Products tables, determine for...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
+ INNER JOINS: Join three tables: Using the Order Details, OrderHeaders, and Products tables, determine for each product the average price received in 2019 and compare this amount to the list price (the unit price in the Products table). In your output display (1) ProductID, (ii) AveragePriceReceived (i.e., average sales unit price in 2019 for each product where sales unit price is UnitPrice*(1- Discount) from the OrderDetails table), (iii) UnitPrice from the products table, and (iv) a new calculated field that calculates the percentage difference between AveragePriceReceived and the UnitPrice in the products table. Name this field PercentPrice Difference. 14 SELECT * FROM OrderDetails; 15 SELECT * FROM OrderHeaders; 16 SELECT FROM Products; Grid view MN +55 7 00 Form view OrderID ProductID 10248 10248 10248 10249 10249 10250 10250 10250 10251 10251 Status 72 14 42925 2 65 1 UnitPrice 14 9.8 34.8 18.6 42,4 16.8 16.8 15.6 Quantity Total rows loaded: 2155 12 Discount оооооо 10 35 0.150000006 15 0.150000006 6 0.050000001 15 0.050000001 [25:14:10] Query finished 10.001 second(s), [23:16:38] Error while executing SQL query on database 'Northwind Origina [23:23:09] Query finished in 0.000 second(s), or 2 13 14 SELECT * FROM OrderDetails; 15 SELECT FROM OrderHeaders; 16 SELECT * FROM Products; 17 Grid view 3 V x K ← 1 1 2 3 4 529 co on 6 7 8 9 Form view Status OrderID Customer II Employeell 10249 TRADH 10252 SUPRD 10250 HANAR 10251 VICTE 10255 RICSU 10253 HANAR 10248 WILMK 10256 WELLI 10257 HILAA 10251 CHOPS ➜ ice Products.UnitPrice); Total rows loaded: 830 OrderDate RequiredDa ShippedDate ShipVia 6 2017-04-26 2017-06-07 2017-05-01 1 4 2017-04-30 2017-05-28 2017-05-02 2 4 2017-04-29 2017-05-27 2017-05-03 2 3 2017-04-29 2017-05-27 2017-05-06 1 9 2017-05-03 2017-05-31 2017-05-06 3 3 2017-05-01 2017-05-15 2017-05-07 2 5 2017-04-25 05-23 2017-05-07 3 3 2017-05-06 2017-06-03 2017-05-08 2 4 2017-05-07 2017-06-04 2017-05-13 3 5 2017-05-02 2017-05-30 2017-05-11 2 Freight ShipName 11.61 Toms Spezialitäten 51.3 Suprêmes délices 65.83 Hanari Carnes 41.34 Victuailles en stock 148.33 Richter Supermarkt 58.17 Hanari Carnes 32.38 Vins et alcools Chevalier 13.97 Wellington Importadora 81.91 HILARION-Abastos 22.09 Chan-cuau Chinara [23:30:50] LITOI WHILE Executiny se query off data or wint nighttrapshear SELECT SYyntax error [23:23:09] Query finished in 0.000 second(s). [23:23:56] Query finished in 0.002 second(s). ShipAddress Luisenstr. 48 Boulevard Tirou, 255 Rua do Paço, 67 2, rue du Commerce Starenweg 5 Rua do Paço, 67 59 rue de l'Abbaye Rua do Mercado, 12 Carrera 22 con Ave. Carlos Soublette #8-35 Haunter 21 I ShipCity Münster Charleroi Rio de Janeiro RJ Lyon Genève Rio de Janeiro RJ Reims Resende SP San Cristóbal Táchira Born ShipRegion NULL NULL NHEE NULE ShipPostal ShipCountry 44087 Germany B-6000 Belgium 05454-876 Brazil 69004 France 1204 Switzerland 05454-876 Brazil 51100 France 08737-363 Brazil 5022 Venezuela 2012 Switzerland 14 SELECT * FROM OrderDetails; 15 SELECT * FROM OrderHeaders; 16 SELECT * FROM Products; Grid view Form view ANTS SNOO 1 2 3 4 8 ProductID ProductName Status 1 Chai 2 Chang 1 3 Aniseed Syrup 4 Chef Anton's Cajun Seasoning 5 Chef Anton's Gumbo Mix 6 Grandma's Boysenberry Spread 7 Uncle Bob's Organic Dried Pears 8 Northwoods Cranberry Sauce 9 Mishi Kobe Niku 10 lura [23:25:09] Query Tinished in 0.000 second(s). [23:23:56] Query finished in 0.002 second(s). [23:24:13] Query finished in 0.000 second(s). Total rows loaded: 77 Supplier ID CategoryII QuantityPerUnit 1 10 boxes x 20 bags 1 1 1 24-12 oz bottles 1 2 12-550 ml bottles 2 48 - 6 oz jars 2 36 boxes 2 12-8 oz jars 7.12 - 1 lb pkgs. 2 12-12 oz jars 6 18 500 g pkgs. 9 12 200 maliars WEN NI 2 2 3 3 3 4 A CANON UnitPrice UnitsInStox UnitsOnOr ReorderLev Discontinue 10 FALSE 39 25 FALSE 25 FALSE 0 FALSE 0 TRUE 25 FALSE 10 FALSE 0 FALSE 0 TRUE A FALSE 19 22 21.35 25 30 40 97 21 13 53 120 15 6 29 0 40 70 0 0 0 0 0 0 + INNER JOINS: Join three tables: Using the Order Details, OrderHeaders, and Products tables, determine for each product the average price received in 2019 and compare this amount to the list price (the unit price in the Products table). In your output display (1) ProductID, (ii) AveragePriceReceived (i.e., average sales unit price in 2019 for each product where sales unit price is UnitPrice*(1- Discount) from the OrderDetails table), (iii) UnitPrice from the products table, and (iv) a new calculated field that calculates the percentage difference between AveragePriceReceived and the UnitPrice in the products table. Name this field PercentPrice Difference. 14 SELECT * FROM OrderDetails; 15 SELECT * FROM OrderHeaders; 16 SELECT FROM Products; Grid view MN +55 7 00 Form view OrderID ProductID 10248 10248 10248 10249 10249 10250 10250 10250 10251 10251 Status 72 14 42925 2 65 1 UnitPrice 14 9.8 34.8 18.6 42,4 16.8 16.8 15.6 Quantity Total rows loaded: 2155 12 Discount оооооо 10 35 0.150000006 15 0.150000006 6 0.050000001 15 0.050000001 [25:14:10] Query finished 10.001 second(s), [23:16:38] Error while executing SQL query on database 'Northwind Origina [23:23:09] Query finished in 0.000 second(s), or 2 13 14 SELECT * FROM OrderDetails; 15 SELECT FROM OrderHeaders; 16 SELECT * FROM Products; 17 Grid view 3 V x K ← 1 1 2 3 4 529 co on 6 7 8 9 Form view Status OrderID Customer II Employeell 10249 TRADH 10252 SUPRD 10250 HANAR 10251 VICTE 10255 RICSU 10253 HANAR 10248 WILMK 10256 WELLI 10257 HILAA 10251 CHOPS ➜ ice Products.UnitPrice); Total rows loaded: 830 OrderDate RequiredDa ShippedDate ShipVia 6 2017-04-26 2017-06-07 2017-05-01 1 4 2017-04-30 2017-05-28 2017-05-02 2 4 2017-04-29 2017-05-27 2017-05-03 2 3 2017-04-29 2017-05-27 2017-05-06 1 9 2017-05-03 2017-05-31 2017-05-06 3 3 2017-05-01 2017-05-15 2017-05-07 2 5 2017-04-25 05-23 2017-05-07 3 3 2017-05-06 2017-06-03 2017-05-08 2 4 2017-05-07 2017-06-04 2017-05-13 3 5 2017-05-02 2017-05-30 2017-05-11 2 Freight ShipName 11.61 Toms Spezialitäten 51.3 Suprêmes délices 65.83 Hanari Carnes 41.34 Victuailles en stock 148.33 Richter Supermarkt 58.17 Hanari Carnes 32.38 Vins et alcools Chevalier 13.97 Wellington Importadora 81.91 HILARION-Abastos 22.09 Chan-cuau Chinara [23:30:50] LITOI WHILE Executiny se query off data or wint nighttrapshear SELECT SYyntax error [23:23:09] Query finished in 0.000 second(s). [23:23:56] Query finished in 0.002 second(s). ShipAddress Luisenstr. 48 Boulevard Tirou, 255 Rua do Paço, 67 2, rue du Commerce Starenweg 5 Rua do Paço, 67 59 rue de l'Abbaye Rua do Mercado, 12 Carrera 22 con Ave. Carlos Soublette #8-35 Haunter 21 I ShipCity Münster Charleroi Rio de Janeiro RJ Lyon Genève Rio de Janeiro RJ Reims Resende SP San Cristóbal Táchira Born ShipRegion NULL NULL NHEE NULE ShipPostal ShipCountry 44087 Germany B-6000 Belgium 05454-876 Brazil 69004 France 1204 Switzerland 05454-876 Brazil 51100 France 08737-363 Brazil 5022 Venezuela 2012 Switzerland 14 SELECT * FROM OrderDetails; 15 SELECT * FROM OrderHeaders; 16 SELECT * FROM Products; Grid view Form view ANTS SNOO 1 2 3 4 8 ProductID ProductName Status 1 Chai 2 Chang 1 3 Aniseed Syrup 4 Chef Anton's Cajun Seasoning 5 Chef Anton's Gumbo Mix 6 Grandma's Boysenberry Spread 7 Uncle Bob's Organic Dried Pears 8 Northwoods Cranberry Sauce 9 Mishi Kobe Niku 10 lura [23:25:09] Query Tinished in 0.000 second(s). [23:23:56] Query finished in 0.002 second(s). [23:24:13] Query finished in 0.000 second(s). Total rows loaded: 77 Supplier ID CategoryII QuantityPerUnit 1 10 boxes x 20 bags 1 1 1 24-12 oz bottles 1 2 12-550 ml bottles 2 48 - 6 oz jars 2 36 boxes 2 12-8 oz jars 7.12 - 1 lb pkgs. 2 12-12 oz jars 6 18 500 g pkgs. 9 12 200 maliars WEN NI 2 2 3 3 3 4 A CANON UnitPrice UnitsInStox UnitsOnOr ReorderLev Discontinue 10 FALSE 39 25 FALSE 25 FALSE 0 FALSE 0 TRUE 25 FALSE 10 FALSE 0 FALSE 0 TRUE A FALSE 19 22 21.35 25 30 40 97 21 13 53 120 15 6 29 0 40 70 0 0 0 0 0 0
Expert Answer:
Related Book For
Data Modeling and Database Design
ISBN: 978-1285085258
2nd edition
Authors: Narayan S. Umanath, Richard W. Scammel
Posted Date:
Students also viewed these accounting questions
-
MAKE REFERENCE TO GRAPH ABOVE 1) IN WHICH YEAR WAS THE GREATEST NUMBER OF PEOPLE UNEMPLOYED INTHE PHILIPPINES? 2) WHAT WAS THE PERCENT INCREASE IN POPULATION FROM 1997 TO1999? 3) WHAT WAS THE GDP PER...
-
NAME: Problem 1 (18 points) A 9 inch by 4 inch by 6 inch container weighs 20 lbs when empty. It is filled with concrete which has a density of 4.5 slugs per cubic foot. What is (a) the total mass in...
-
May I know the related concepts? Thank you. You have won a lottery and can choose to receive payment under one of the following two arrangements: (1) $250,000 every year forever, with the first...
-
Question 2A) Explain the differences between right issues and bonusissues. Your answer should include the advantages and disadvantagesof both right issues and bonus issues. [ 8marks}b) Explain pos 0...
-
Without redrawing the figures, discuss how, if at all, the DFDs shown in would change as a result of the following independent situations (be specific in describing the changes): a. Paying a worker...
-
Spud Webb was, at \(5 \mathrm{ft} 8\) in, one of the shortest basketball players to play in the NBA. But he had an amazing vertical leap; he could jump to a height of \(1.1 \mathrm{~m}\) off the...
-
Continuing to focus on evidence associated with the act, concealment, and conversion, use the evidentiary material to continue the examination. In addition, as the examiner also start to think of...
-
The following information is taken from Hamilton Townships December 31, 2013, trial balance after all adjustments were made for preparation of the government- wide financial statements. Hamilton...
-
Mr. Amar is 30 year old, newly married and a successful actor in the Indian film industry. Right from his struggling days, Amar always saved a part of his income and invested in safe instruments like...
-
IBS is a global provider of point-of-sale systems and related services that enable businesses to accept electronic payments. As a new hire in the companys international headquarters accounting...
-
The hospital has announced merit increases. The amount of the raise is based on the evaluation score. Using the the employee information in the table below, calculate the new salary. Use formulas to...
-
Show how priority inheritance can cause a deadlock. Consider three tasks (with 1 > 2 > 3 ) and appropriate lock unlock sequences.
-
A software module is to take as inputs four signed 16 - bit integers and produce two outputs, the sum and average. How many test cases would be needed for an exhaustive testing scheme? How many would...
-
The United Nations Conference on Trade and Development (UNCTAD) provides ranking of the largest transnational corporations (TNCs) in the world, including a ranking of the 100 largest financial TNCs...
-
Do the same as Exercise 8.3, except recalculate now the FP+ (feature point) metric. How many lines of C ++ code do you estimate will be needed? Data from Exercises 8.3 Recalculate the FP (function...
-
Answer true or false to the following statements: a. Microsoft's SourceSafe is an example of a software-based librarian. b. In a typical IT shop, analysts spend at most about 20 percent of their time...
-
Shaw Ltd plans to maintain its optimal capital structure of 40% debt, 10% preference shares and 50% ordinary shares into the future. The cost of each component is: after -tax debt, 5%; preference...
-
Separate variables and use partial fractions to solve the initial value problems in Problems 18. Use either the exact solution or a computer-generated slope field to sketch the graphs of several...
-
What is the difference between a binary relationship that exhibits a 1:1 cardinality constraint and a binary relationship that exhibits a 1:n cardinality constraint?
-
Explain why a file-processing system may be referred to as belonging to a two-schema architecture.
-
Identify the set of functional dependencies in the relation instance CAR shown below. Does this constitute the minimal cover for the set of functional dependencies present in CAR? If it is not a...
-
Prove Part 1 of Theorem 1.14 using induction. That is, prove that for any non-negative integer \(k\), \[H_{k}(x)=\sum_{i=0}^{\lfloor k / 2floor}(-1)^{i} \frac{(2 i) !}{2^{i} i...
-
Use Theorem 1.13 (Taylor) to find fourth and fifth order polynomials that are approximations to the standard normal distribution function \(\Phi(x)\). Is there a difference between the...
-
Prove Part 2 of Theorem 1.14. That is, prove that for any non-negative integer \(k \geq 2\), \[H_{k}(x)=x H_{k-1}(x)-(k-1) H_{k-2}(x) .\] The simplest approach is to use Definition 1.6. Theorem 1.14....
Study smarter with the SolutionInn App