Pregunta de entrevista de UBS

Question on aggregate function on sql