Cognizant interview question

sql queries