Instead of having a "same_course_id" and things like "average_rating", "average_rating_same_prof" on the courses table, we should make courses map to rows in a "recurring_courses" table that has the "same_course_id" as a PK and "average_rating" etc. as values. This way we can move a lot of the cross-course analysis over.