JOIN on variable number of columns
Try and see if this yields the result you want:

SELECT some_description
FROM something_about_courses A
JOIN courses B
ON (A.course_code = B.course_code
AND A.course_session = B.course_session
AND (A.course_type = B.course_type OR B.course_type IS NULL))