Pergunta de entrevista da empresa GALLO

The first was a SQL query and the second was a question to filter a given input.