BEGIN TRAN ROLLBACK USE AdventureWorks UPDATE Sales.SalesPerson SET SalesYTD = SalesYTD + ( SELECT SUM(so.SubTotal) FROM Sales.SalesOrderHeader AS so WHERE so.OrderDate = (SELECT MAX(OrderDate) FROM Sales.SalesOrderHeader AS so2 WHERE so2.SalesPersonID = so.SalesPersonID ) AND Sales.SalesPerson.SalesPersonID = so.SalesPersonID GROUP BY so.SalesPersonID ) ------------- USE AdventureWorks UPDATE Production.Product SET ListPrice = ListPrice * 1.1 FROM Production.Product AS P INNER JOIN Production.ProductSubcategory AS PS ON P.ProductSubcategoryID=PS.ProductSubcategoryID WHERE ProductCategoryID= 3 USE AdventureWorks UPDATE Production.Product SET ListPrice = ListPrice * 1.1 WHERE ProductSubcategoryID IN ( SELECT ProductSubcategoryID FROM Production.ProductSubcategory WHERE ProductCategoryID= 3 )