Accenture interview question

it was related to SQL question