Have unique child value per parent

I have a parent doc: Class & Child doc: Class_Students which has columns Student Name & Gender

I want to have a validation where a student can be added to multiple classes but a student can be added only once per class

Is such kind of validation possible without writing scripts?

Also Note, there is no document named Student, the child table has 2 sting columns