Orange Interview Question

an on spot sql query