From the course: MySQL Data Analysis
Unlock this course with a free trial
Join today to access over 24,600 courses taught by industry experts.
LEFT vs. INNER vs. RIGHT JOIN - MySQL Tutorial
From the course: MySQL Data Analysis
LEFT vs. INNER vs. RIGHT JOIN
- [Instructor] Okay, now that we've talked about LEFT INNER, and RIGHT JOIN, let's hold them up side by side and compare outputs so that you can really understand the little nuances between the joins. As you're getting up to speed, I would suggest going to the course materials, finding this slide and printing it out. I think this side-by-side comparison is the best way to understand what's happening with each of these. So, we've got two tables, the actor and the actor award table, and in each of the three queries, actor is on the left, and actor award is on the right. The only difference between the three queries is the type of join. We have LEFT, INNER and RIGHT. Let's take a look at what happens to the results with each of the types of queries. When we use LEFT JOIN, it returns all values from the left table and then brings in any values from the right table where there's a match. It returns null for the right table where no match is found. So, take a look down here. What we see is…
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
-
-
-
-
-
-
-
(Locked)
Introduction30s
-
(Locked)
Normalization and Cardinality3m 47s
-
(Locked)
Relationship diagrams1m 10s
-
(Locked)
Multi-table querying1m 4s
-
(Locked)
Reviewing the maven movies database1m 44s
-
(Locked)
Common JOIN types2m 25s
-
(Locked)
INNER JOIN1m 31s
-
(Locked)
INNER JOIN example5m 49s
-
(Locked)
Challenge: INNER JOIN42s
-
(Locked)
Solution: INNER JOIN4m 13s
-
(Locked)
LEFT JOIN1m 39s
-
(Locked)
LEFT JOIN example4m 43s
-
(Locked)
Challenge: LEFT JOIN42s
-
(Locked)
Solution: LEFT JOIN3m 57s
-
(Locked)
RIGHT JOIN1m 41s
-
(Locked)
LEFT vs. INNER vs. RIGHT JOIN3m 18s
-
(Locked)
FULL OUTER JOIN1m 27s
-
(Locked)
Pro tip: Bridging unrelated tables6m 51s
-
(Locked)
Challenge: Bridging tables57s
-
(Locked)
Solution: Bridging tables4m 25s
-
(Locked)
Multi-condition joins2m 40s
-
(Locked)
Challenge: Multi-condition joins44s
-
(Locked)
Solution: Multi-condition joins4m 42s
-
(Locked)
The UNION operator2m 15s
-
(Locked)
UNION example3m 51s
-
(Locked)
Challenge: The UNION operator32s
-
(Locked)
Solution: The UNION operator2m 41s
-
(Locked)
-