For example, I have to program an enrolment table which has:
Add a unique constraint to your table:
ALTER TABLE yourtable ADD CONSTRAINT constraintname UNIQUE (student_id, subject, academic_period)