From the course: From Excel to SQL

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

The different types of JOINs

The different types of JOINs

From the course: From Excel to SQL

Start my 1-month free trial

The different types of JOINs

- So when you're working with data, that spread across multiple tables, you have some options for how to combine that data. Now, when we started with the basics on the join clause, we combine two tables to find the names of the companies, office managers, and here's how we wrote that query. And now let's quickly run that query again. You can see we get back 10 results and this type of join is known as an INNER JOIN and can be written as such by adding inner to the join clause. Like so, if we rerun the query, we get back the same results, as we would expect. So a little more about the INNER JOIN. It returns any values that exist in both the tables we're joining together, given the conditions specified in the on clause. And this is why we get back on in the names of the office managers. Because their ID appears in both the departments table and the employee's table. If we were to remove the on clause entirely and…

Contents