Question d’entretien chez Bank of America

Optimize the given SQL query