Recall & Review
beginner
What does a LEFT JOIN do in SQL?
A LEFT JOIN returns all rows from the left table and the matching rows from the right table. If there is no match, the result will contain NULL for columns from the right table.
Click to reveal answer
beginner
Write the basic syntax of a LEFT JOIN.
SELECT columns FROM left_table LEFT JOIN right_table ON left_table.key = right_table.key;
Click to reveal answer
intermediate
Why might you use a LEFT JOIN instead of an INNER JOIN?
Use LEFT JOIN when you want to keep all records from the left table, even if there are no matching records in the right table. INNER JOIN only returns rows with matches in both tables.
Click to reveal answer
beginner
In a LEFT JOIN, what happens if the right table has no matching row?
The columns from the right table will contain NULL values for that row in the result.
Click to reveal answer
intermediate
Can a LEFT JOIN return more rows than the left table originally has? Why or why not?
Yes, if a single row in the left table matches multiple rows in the right table (one-to-many relationship). A LEFT JOIN always returns at least as many rows as the left table, since every left row is included at least once.
Click to reveal answer
What does a LEFT JOIN include in its result?
✗ Incorrect
LEFT JOIN returns all rows from the left table and matching rows from the right table, filling with NULLs if no match.
If a row in the left table has no match in the right table, what will the right table columns show?
✗ Incorrect
When no match exists, the right table columns show NULL in the result.
Which SQL keyword is used to perform a LEFT JOIN?
✗ Incorrect
The keyword LEFT JOIN is used to perform a left join operation.
Can a LEFT JOIN result have fewer rows than the left table?
✗ Incorrect
LEFT JOIN returns all rows from the left table (at least once), so the result has the same number or more rows (if multiple matches in right table).
Which join would you use to keep all rows from the left table regardless of matches?
✗ Incorrect
LEFT JOIN keeps all rows from the left table, matching rows from the right or NULL if no match.
Explain in your own words what a LEFT JOIN does and when you might use it.
Think about keeping all your main list and adding details if available.
You got /4 concepts.
Describe the difference between LEFT JOIN and INNER JOIN with an example scenario.
Imagine a list of customers and their orders.
You got /4 concepts.