XL Dynamics interview question

Query based on SQL.