From the course: MySQL Data Analysis
Unlock this course with a free trial
Join today to access over 24,800 courses taught by industry experts.
INNER JOIN example - MySQL Tutorial
From the course: MySQL Data Analysis
INNER JOIN example
- [Instructor] Okay, let's talk more about INNER JOIN, and then we'll get into a demo to show you exactly how it works. So INNER JOIN lets you pull records from two tables at once, and it only returns records when the JOIN ON logic produces a match. After the FROM clause, we add INNER JOIN, followed by the name of the table we want to join to, and then followed by the logic for how we want the server to perform the join. We'll get into what that means in a second. When you write queries using multiple tables, you need to specify both the table and the column name in your SELECT statements. Again, I'll show you that in the demo. Let's jump over to Workbench, and I'll walk you through a couple examples. Okay, so here, I've got a fairly simple query. I'm selecting DISTINCT inventory_id FROM inventory. And I'm running a LIMIT 5000. So LIMIT 5000 may be new to you. One thing you may have noticed previously is the responses had been limited to 1,000 rows. The default limit that comes in…
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)
-