Accenture Interview Question

asked for algorithms and sql related queries