Hi there, so by now you might be all joined out, because we've covered a lot of different joins in this module. But there is one more that I want to go over with you, and that's called the union. The union is one of those things that I wouldn't say I use a lot in my day to day work. But when I do need it, I'm like yes, this is exactly the thing I need to use to get the job done. So I think it's useful to go over it. It's kind of like a secret weapon. It probably won't be your go-to, and you're certainly not going to use it every day. But when you do need it, it's going to save you a lot of time, all right. So after this video, you'll be able to describe what a UNION does and how it does it, discuss the parameters and rules for when you can employ a UNION, write out the appropriate syntax for a proper UNION statement, and describe some common situations where it could be useful. Okay, so to begin, a UNION is used to combine the results of two or more queries or table sets into one table and one statement. So each select statement gets unioned with each other and kind of stacked on top of each other. The best way I can think of this is when I may ask someone to build me a building that's 20 stories tall and I have 2 people to build it. So I may ask the first person to build the the first ten floors, and the second person to build the top ten floors. So that's great, both of them can work independently from each other. But at the same point, I want to put these two back together. And so it's really important to know where the stairs are at, how wide or long the building is, to make sure that everything's the same size, and can fit back together. It's kind of similar with the UNION, so you have two separate pieces, two separate tables or queries, and you're literally going to just stack them on top of each other. So to do this, you must have the same number of columns, right? Going back to our metaphor, the building needs to be the same size, and you must also have similar types of data. So you can't just throw an integer on top of a string, the data types need to be the same. And if there weren't enough, then I also want to make sure the columns are in the same order. So I want to make sure my whole building is the same size, and I want to make sure that the floor plans look similar. But if I put the stairs on the west side in one building and then the east side on the other building, that's not going to work out very well. So you also want to make sure your columns are all arranged in the same order. Okay, let's look an example. What we're going to do is select customers from Germany, and we want what cities in Germany our customers are from. We also then want to know what cities we have suppliers in. And so what we're going to do is we're going to write two separate queries, one to get what cities from the customers and then the cities from the suppliers. And then we going to add those together, so we know where we have a presence, whether it's by a customer or by a supplier. So the syntax for this is you have your SELECT statement with your column names from your table, and then you list WHERE the UNION, and then you also have your second SELECT statement. So this is different in fact, that most of the joins we've been doing up to this point, we have our whole SELECT statement, we say where and how we want it joined. This we say, our SELECT statement, we say our joined, and then we say the other statement that's going to stack. So in our example here, what we have is our first statement. So we're selecting City and Country from Customers table, where the country equals Germany. So for this, we don't have to have the WHERE clause, but we just want to limit to Germany. Then in our second statement, we're going to first say UNION and then we're going to write our second statement. So now, we're selecting cities and countries, but from the Suppliers table. Again, we want just the countries of Germany, and we're going to order these by the city name. So now we have a list. Maybe this is something we want to plot on a map for marketing to say hey look, we have business relations with all the cities in Germany. And so we're classifying our business relations as both customer relations and supplier relations. And so now we have a really nice list that we could go and plot on a map somewhere to say where all our customers are, and list our business relationships out. So that, in a nutshell, is a union. You should now have a good idea of what it is. How the tables need to be constructed for it to work properly. How to use it in a SELECT statement, and a situation or two where it might prove very useful to you. Again, this isn't an operator I use every day. But I use it enough, that I think it's handy for you to know.