From the course: SQL Essential Training

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Types of JOINs

Types of JOINs

- [Instructor] So far, we've used joins to access the fields of multiple tables. We've identified the primary key of the customer table, identified a similar foreign key in the invoice table, and then we used the ON keyword to link the two tables together, hoping that the data matches up. Now consider this: what happens if the data from the tables we join does not match up completely? And here's what I mean by this. What if we had a customer, let's call him customer 6, delete his WSDA music account and was subsequently removed from the customer table altogether. Because WSDA music is required to keep financial records, there's still evidence from the invoice table that customer 6 made a purchase at some point. It's not unusual to find discrepancies in a database and we must decide whether we want our query to include data that does not match up or exclude it altogether. To handle discrepancies between tables,…

Contents