Pregunta de entrevista de Fidelity Investments

Given a scenario, write the correct query.