Accenture Interview Question

it was related to SQL question