Appinventiv interview question

7 : Self join query