LEFT JOIN Practice
LEFT JOIN returns ALL rows from the left table, plus matching rows from the right table. If there's no match, you get NULL values for the right table's columns.
LEFT JOIN Visualization
Table A (LEFT) Table B
+----+ +----+
| 1 | JOIN | 1 | ← Matched
| 2 | ==== | 3 |
| 3 | | 4 |
+----+ +----+
Result:
| A | B |
|---|------|
| 1 | 1 | ← Matched
| 2 | NULL | ← No match, but included with NULL
| 3 | 3 | ← Matched
When to Use LEFT JOIN
Use LEFT JOIN when you want ALL records from one table, regardless of whether they have related records in another table.
Example: "Show all users, including those who haven't placed orders"
Exercises
Loading exercise...
Loading exercise...
Loading exercise...
Loading exercise...
Loading exercise...
INNER vs LEFT JOIN
| JOIN Type | Returns |
|---|---|
| INNER JOIN | Only matching rows from both tables |
| LEFT JOIN | All rows from left table + matches from right |
Free Practice
Loading SQL editor...
Try:
- Find categories with no products
- List all products with order counts (including 0)
- Compare LEFT JOIN vs INNER JOIN results
التالي · الدرس 21 من 27
Joining Multiple Tables
قراءة 1 دقيقة
أنهيت 20 من 27 درسًا

اسأل Byte عن هذا الدرس
محادثة خاصة حول هذا الدرس. قرأ Byte الدرس كاملًا، ويجيب خلال ثوانٍ، ويُظهر القسم الذي تأتي منه كل إجابة. يمكنك السؤال بأي لغة.
الأسئلة والأجوبة
أسئلة عامة حول هذا الدرس. يجيب AI Tutor فورًا بلغتك، ويراجع فريق FreeAcademy الإجابات، ويمكن لكل المتعلمين قراءتها.

