Combining quizzes with courses

Community Novice

We are trying to connect Canvas quizzes to course codes and are unable to make it work. The problem is one course id has multiple course codes in the course_dim table. So if we join the quiz_dim and the course_dim table, the same quiz would be joined to multiple course_codes which should not be the case. Ideally every course_id should have only one course_code in the course_dim table. So we need to know if there is some other field that can be used to connect quizzes with course codes. Any help would be appreciated!