Infosys interview question

sql, java