Accenture interview question

C coding. SQL queries