Cognizant interview question

Based on MySql , Programming and algorithms