First, you perform a UNION ALL between the set of materials belonging to the course in C1 and the set of materials belonging to the course in C2.
You group the result by materialid and see whether any of the groups (materials) contains only one member.