From the course: MySQL Data Analysis
Unlock this course with a free trial
Join today to access over 24,700 courses taught by industry experts.
Multi-condition joins - MySQL Tutorial
From the course: MySQL Data Analysis
Multi-condition joins
- [Instructor] All right. So now that you're getting sort of advanced, we're ready to start talking about multi condition joins. Up until now, when we've joined from one table to another, we've only set one specific rule in which we need to make that join. For example, table A, column one equals table B, column three. That's an example of a single condition join. Now we're going to talk about multi condition joins. So take this example where we're joining from film to film category, to category, and we have a where condition because we want to limit to films where their category is horror. Now take a look at this other query. Notice there's no where condition. We've taken that where condition and we've brought it into the join to category. This is an example of a multi condition query. So that top query joins film to film category, to category, bringing in all the records, and then filters down that record set to just films where category name equals horror. The query on the bottom…
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)
-