We refer to the first select as the calling select, or the main select or the outer
select; the select of the subquery is the inner select.
As we saw in the introductory example, membership can be tested using in.
Here is another example.
Example 5.10.1 Let us find the names of students who took cs310. We determine the student numbers of those students using a subquery. Then, in the
main select, we retrieve those students whose student number is in this set.
This can be accomplished using the query: