Aptean Interview Question

SQL was more difficult then I thought