Normally you
SELECT values from database tables. However, you can also SELECT values from
another query. These other queries are called subqueries. The subquery can be a
stand-alone SQL statement. Or it can reference the outer query, making it a
correlated subquery.
EXISTS is a
procedure is found in the WHERE clause of a query. EXISTS takes a parameter
that is a subquery. EXISTS will returns a value of TRUE if the subquery has at
least one row in its results.
A Table Expression is a named query. Every
column in it must have a name. There is normally no ORDER BY allowed in a Table
Expression. The exception to this is when you are using TOP. There are four
different types of Table Expressions: (1) derived tables, (2) CTEs, (3) views,
and (4) inline table valued functions. These four type will require a separate
writeup to explain.