Orange interview question

an on spot sql query