TSQL Challenge 39 - Calculate Gross Profit by Item using FIFO method
This challenge is related to an inventory management application where your job is to calculate the profitability by item (cost vs sales) using First-In-First-Out (FIFO) processing method.
http://beyondrelational.com/puzzles/challenges/43/calculate-gross-profit-by-item-using-fifo-method.aspx