XL Dynamics Interview Question

Query based on SQL.