I was trying to insert rows into a table called subjects , i wrote the following query so that the duplicates can't occur. But this is not working.
INSERT INTO subjects ( stu_id, sub_id ) VALUES (16, 39)
WHERE NOT EXISTS ( SELECT * FROM subjects WHERE stu_id = 16 AND sub_id = 39 );