Infosys interview question

Was asked to write DB query and also about C programming