Create a unique constraint on academic_period, student_id, subject
I'll let you work out the actual SQL
Note: this is correctly your natural key: enrolment_id is a surrogate added at implementation time because of the database architecture. It isn't mandated in any design or modelling process