Accenture Interview Question

C coding. SQL queries