Pergunta de entrevista da empresa Point72

Write a SQL query to solve this problem