L&T Finance interview question

More question based on sql and java