In this chapter, we have learned two new ways to combine sets of data. First, using the subquery, we learned to nest queries inside of each other to combine data from tables without a direct relationship. We looked at ways to manipulate scalar subqueries that return a single value, multi-row subqueries that return multiple values, and multi-column subqueries that return values from more than one column. We followed this up with a look at using SQL set operators to combine overlapping and non-overlapping data.
In this chapter, we've come to the end of our exploration of the use of DML
statements and techniques. However, although we have learned countless ways to manipulate table data, we have yet to learn how to actually create a table from scratch using SQL. The next chapter will introduce the concept of database object creation using a sublanguage of SQL known as DDL (Data
Definition
Language).