Hexaware Technologies Interview Question

They ask me to write SQL query they have provided condition.