Pi Techniques interview question

SQl question and c#