Oracle Interview Question

Different ways to solve the problem