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 - SQL Tutorial
From the course: SQL Essential Training
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,…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
Joins explained1m 41s
-
(Locked)
How tables share a relationship, part 15m 53s
-
(Locked)
How tables share a relationship, part 24m 22s
-
(Locked)
Simplifying JOINs5m 41s
-
(Locked)
Types of JOINs2m 55s
-
(Locked)
The INNER JOIN2m 20s
-
(Locked)
The LEFT JOIN2m 59s
-
(Locked)
The RIGHT JOIN3m 29s
-
(Locked)
Tables and Entity Relationship diagrams4m 41s
-
(Locked)
Joining many tables5m 45s
-
-
-
-
-
-
-
-