Accenture interview question

asked for algorithms and sql related queries