Lagnam InfoTech interview question

one query on self join