Sage interview question

Basic SQL operations, and a problem solving question.