Given this ER chart
We have Students who are allowed to participate in the Exam, and each Exam can be divided into several Startups (for example, to divide large groups in several rooms or have two runs for the same Exam at once) Is it possible to provide (through the limitations of the base data) so that students participate only in Runs belonging to the exams to which they were admitted?
I could not find a way myself, and I also do not know how to do this for an Internet search.
: : id, name student: id, name run: id, exam_id ( exam.id), ( ),
, , : int_exam_to_student: exam_id, student_id -
, , : run. * from run join int_exam_to_student on (run.exam_id = i.exam_id), i.student_id = 123;