CTS2437CAssignment4

.docx
Step 1: SELECT COUNT (*) AS NumberOfOrders, SUM (TaxAmount) AS SumTaxAmount FROM Orders; B Resuts [ Messages NumberOfOrders ~ SumTaxAmount 1141 | 2541.96
Step 2: SELECT CategoryName, COUNT(*) AS ProductCount, MAX(ListPrice) AS MostExpensiveProduct FROM Categories ¢ JOIN Products p ON c.CategoryID = p.CategoryID GROUP BY CategoryName ORDER BY ProductCount DESC; EH Results 2l Messages CategoryName ProductCount MostExpensiveProduct 1 i Guitars L6 2517.00 Basses 2 799.99 3 Drums 2 799.99
Step 3: SELECT EmailAddress, SUM(ItemPrice * Quantity) AS ItemPriceTotal, SUM(DiscountAmount * Quantity) AS DiscountAmountTotal FROM Customers c JOIN Orders o ON c.CustomerID = JOIN OrderItems oi ON o0.0rderID GROUP BY EmailAddress ORDER BY ItemPriceTotal DESC; 0.CustomerID = 01.0rderID BH Resuts [l Messages EmailAddress temPriceTotal DiscountAmount Total 1 | [email protected] | 6395.95 1829.10 2 allan.sherwood @yahoo.com 4131.00 1830.39 3 [email protected] 3316.99 1428 .84 4 [email protected] 3216.00 1518.54 5 [email protected] 3016.95 1433.84 6 [email protected] 2517.00 1308.84 7 [email protected] 2517.00 1308.84 8 mattie @aol.com 2517.00 1308.84 9 gruta@cox net 2398.00 719.40 10 [email protected] 2398.00 719.40 11 sage_wieser@cox net 2398.00 719.40 12 [email protected] 2398.00 719.40 13 [email protected] 2398.00 719.40 _ 14 _ frankwilson@shecalohal net 2198 97 660 NN
Uploaded by ProfessorElement7968 on coursehero.com