Pregunta de entrevista de Klar

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