Before I get into the question, I am not asking about a one to many relationship.
I have a table called enrollments, an enrollment can either be a lecture, test, or aptitude. The table enrollments has a one to many relationship with the lectures table, the tests table and the aptitudes table.
My question is: how can I make it so an enrollment is allowed to be linked to only one of these three tables? Currently the database allows the enrollment to be both a lecture and a test for example, which shouldn't be possible.
Visual representation of the problem:

I googled for a good few hours but could not find anyone with a similar problem, please help. Thanks in advance.