Actually the confusion is created because of the fact we know that "IN" clause is used in nested query without correlation and hence inner query is independent of outer query.
But we know "IN" clause is used for checking membership which is done here as well.We know that the "IN()" clause is equivalent to "=ANY()" clause .So having selected an S.course_id first , it checks in the subquery whether there is an instance T.course_id which satisfies both semester = "3rd" and year = "2015" and that whether such T.course_id = S.course_id .If any such T.course_id exists then it means the subquery result returns true and as a result that S.course_id is selected.
We do the same thing for all S.course_id and check for it in the subquery condition.
Actually the confusion created in the question is inner query is executed once then the outer query uses the result of inner query.But here repetitive execution of inner query is required since we are checking in the subquery "S.course_id = T.course_id" so for every S.course_id , every T.course_id that satisfies semester = 3rd and year = 2015 needs to be checked.
Hence both the queries are correct in this case.
Hence A) is the correct option.