Set theory is the underlying concept of SQL. A set is a collection of zero or more objects. Each object in a set is called an element. In MySQL, a table corresponds to a set, and a record corresponds with an element. You can get a subset from a set. A subset is a smaller set of elements from the set. In SQL, you can get a subset by using a WHERE clause. A cross product is a set created from two or more sets. In SQL, a cross product is a join. To create different sets of data in SQL, you can use the intersection, difference, and union joins. Each of these is explained in more detail in the following sections.
Understanding set theory
Understanding what a UNION join is and learning how to use it in a SQL query
UNION allows...