C-DAC Interview Question

Prime number , sql joins , query