The Orion.order_fact The Orion.product_dim i. Creating a Summary Report from Two
ID: 3179882 • Letter: T
Question
The Orion.order_factThe Orion.product_dim
i. Creating a Summary Report from Two Tables The head of the Sales Department wants to know how many of each product was sold since the beginning of 2010. The report should include the product ID, the product name, and the total sold for that product and ordered to match the output shown below. The data that you need can be found in the listed columns of the following tables: orion product im Contains Product ID Product Name onion order act contains Product ID Quantity Partial Rkoc sQL output Total Quantities Sold by Product ID and Name Total Product ID Product Name Sold 230100600016 Expedition zero, Medium, Right.charcoal 230100700011 Hurricane 4 23010060003 Sleeping Bag. Lar Right, Blue/Black 240800200035 Shine Black PRO 24070010000 Armour L 220101400088 casual Genuine Polo-shirt Hi-fly Intrepid stand 8 Black 2402001001 18 2401001 00312 Mini Backboard Bulls 230100500082 Luc Tech Intergal fB Rain Pants
Explanation / Answer
Below is the SQL procedure to produce the output shown in the question statement:
proc sql;
select a.Product_Id, a.Product_Name, sum(b.Quantity) as Total_Sold from orion.product_dim a inner join orion.order_fact b on a.Product_Id= b.Product_Id where b.Order_Date >= '01Jan2010'd group by a.Product_Id, a.Product_Name order by Total_Sold desc;
quit;
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.