Code for populating student_teacher joiner table