Hexaware Technologies interview question

SQL query