Cognizant interview question

questions from strings and arrays , and sql question