Oracle interview question

Different ways to solve the problem