Pergunta de entrevista da empresa Klar

Optimize a SQL query and how would I filter some data using Python