Cognizant interview question

Regarding general coding and basic SQL questions.