• Great article. I think a solid grounding in set theory would be very helpful for many DBAs.

    If I may respectfully offer a couple of minor corrections and clarifications though:

    Your definition of subset is mathematically the definition of a Proper Subset. A subset can contain the same number of elements as the original set. This is significant in a number of proofs in set theory, and is also very significant when dealing with infinite sets (admittedly, you will never see an infinite set in SQL). For instance, the set of even integers is a subset of the set of integers, but they both contain an infinity of elements (even more precisely, they both contain Aleph_null elements).

    Also, you correctly quote Cantor's definition, but one element of that definition is worth noting in SQL. It requires the elements to be "definite and separate." In other words, unique. That is why the normal except, intersect and union operators all enforce distinctness by default (there are variations like UNION ALL which do not enforce distinctness and also often operate substantially faster). But it also shows that SQL Server is more inspired by rather than really implementing set theory. SQL Server permits tables, and definitely results, to contain duplicated rows.

    And finally, if I may point out that "Applied Mathematics for Database Professionals" is a great book that goes through these topics.

    ---
    Timothy A Wiseman
    SQL Blog: http://timothyawiseman.wordpress.com/