Pregunta de entrevista de Oracle

Prime number code in preferred language, SQL query on group by.