Trianz Interview Question

programming in c,sql query