Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Introducing the SQL commands that allow us to perform relatively complex set operations on a database.
As with the other topics we’ve covered in this series, there is a wealth of information available on the topic of sets, databases, and SQL.
Check out this great read on Set Theory and SQL: “SQL-99 Complete, Really”, by Peter Guzman & Trudy Pelzer hosted on MariaDB
The link above contains more than just UNION, INTERSECT and EXCEPT, but there is a section towards the end that applies those operations to the larger discussion. This is a wonderful article!
Other good reads about Set Operations include:
Union and Union All:
In our last stage,
we learned how to merge dates together from two different tables with SQL Joins.
In this stage, we're going to learn about set operations.
Set operations allow you to perform different tasks on separate tables or
You can use these operations to combine two or
more datasets into one in various ways or to limit the results of one with another.
There are four set operations, Union, Union All, Intersect and Except.
Union and Union All combine data from multiple tables into one result set.
Intersect produces a result set from values of rows that's are in common
between both tables.
And except produces a result set of values of rows that exist in the first table,
but not the second.
Will be taking a look at these set operations in more detail in this stage.
You need to sign up for Treehouse in order to download course files.Sign up