Koch interview question

Write C# code that will pull relevant rows from SQL and calculate a value.