NIIT Limited interview question

question on java, sql.