We've covered INNER JOIN
for matching records, LEFT JOIN
for keeping all records from the first table, and chaining multiple joins together. Choosing the correct one is a critical SQL skill.
This lesson will test your ability to select and build the right join for various business needs.
Engagement Message
Ready to put your joining skills to the test?
Type
Swipe Left or Right
Practice Question
For each business question, swipe to the most appropriate JOIN type.
Labels
- Left Label: INNER JOIN
- Right Label: LEFT JOIN
Left Label Items
- List all products that have been reviewed
- Show only the students enrolled in a class
Right Label Items
- List all employees and their assigned laptops, if any
- Generate a list of all departments, even those without employees
Type
Multiple Choice
Practice Question
Given a Products
table with 10 rows and an Orders
table with 50 rows, a query performs FROM Products p LEFT JOIN Orders o ON p.product_id = o.product_id
. If 3 of the products have never been ordered, how many rows will the result have?
A. 50 B. 47 C. 10 D. 53
Suggested Answers
