What are the ids of students who registered courses?
select student_id from student_course_registrations
What about for students who also attended courses?
select student_id from student_course_registrations intersect select student_id from student_course_attendance
Give the ids for students who did either.
select student_id from student_course_registrations union select student_id from student_course_attendance