Question d’entretien chez Deloitte

Write SQL query interpreting loops in that.