Oracle Interview Question

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