Pregunta de entrevista de Amazon

How would you optimise this sql query?