Pergunta de entrevista da empresa FinBox

How can a query be optimized SQL query to get the Prime numbers SQL query to find the cumulative values in the column Logical questions