SELECT
soh.SalesOrderID,
soh.OrderDate,
SUM(sod.LineTotal) AS TotalSales
FROM
Sales.SalesOrderHeader AS soh
JOIN
Sales.SalesOrderDetail AS sod ON soh.SalesOrderID = sod.SalesOrderID
WHERE
soh.OrderDate >= '2011-01-01'
AND soh.OrderDate < '2023-01-01'
GROUP BY
soh.SalesOrderID,
soh.OrderDate
HAVING
SUM(sod.LineTotal) > 1000
ORDER BY
TotalSales DESC;
Creating Information From Data