SELECT ProductID, SpecialOfferID, AVG(UnitPrice), SUM(LineTotal) FROM AdventureWorks.Sales.SalesOrderDetail GROUP BY ProductID, SpecialOfferID;
SELECT ProductID, SpecialOfferID, AVG(UnitPrice) AS avg_unit_price, SUM(LineTotal) AS sum_line_total FROM AdventureWorks.Sales.SalesOrderDetail GROUP BY ProductID, SpecialOfferID ORDER BY ProductId ASC;