Question d’entretien chez Yahoo

Difficult SQL query question.