LISTING 2: Code to Retrieve Orders with the 11–20th Lowest Total Order Amounts SELECT TOP 10 o.OrderId, SUM(UnitPrice * Quantity) OrderAmount FROM orders o inner join [order details] od on o.OrderId = od.OrderId WHERE o.OrderId NOT IN /* This subquery returns the OrderIds with the 10 lowest order amounts. */ ( SELECT TOP 10 o.OrderId FROM orders o inner join [order details] od on o.OrderId = od.OrderId GROUP BY o.OrderId ORDER BY SUM(UnitPrice * Quantity), o.OrderId ) GROUP BY o.OrderId ORDER BY SUM(UnitPrice * Quantity)