ifusionIT interview question

write and SQL query