Pregunta de entrevista de Elavon

SQL question (moderate difficulty)