Cognizant Interview Question

few questions from java and sql.