C-DAC interview question

Prime number , sql joins , query