Pergunta de entrevista da empresa Revolut

Write an SQL query with aggregation.