Enrol to start learning
Reading is open to everyone. Enrolling is free, and it is what unlocks the audio lessons, practice tests and progress tracking.
2.2. LEFT JOIN
This section
Practice test
11 questions on this section. Wrong answers show you what to read again.
Sign up to take itWhole chapter
Revision test
Mixed questions from across the chapter. Your answers get marked.
Sign up to take itQuick
Flashcard drill
2 cards from this lesson. Good the night before a test.
Try these first
- 1.
What does a LEFT JOIN do in SQL?
Hint
Think about the tables involved and which records are included.
- 2.
In which scenario would you prefer using LEFT JOIN over INNER JOIN?
Hint
Consider what happens when there's missing data.
- 3.
What does LEFT JOIN return when there are no matching records in the right table?
- Only matching records
- All records from the left table
- No records
Hint
Consider what LEFT stands for in LEFT JOIN.
- 4.
True or False: LEFT JOIN omits records from the left table if there are no matches in the right table.
- True
- False
Hint
Reflect on the definition and purpose of LEFT JOIN.
- 5.
Suppose you have two tables: 'employees' and 'departments'. Write a LEFT JOIN query to list all employees and their departments, ensuring to include employees who might not belong to any department.
Hint
Consider how employees relate to departments.
- 6.
Imagine you are analyzing a customer database where some customers have not made any purchases. Formulate a LEFT JOIN query that tallies the purchases made by each customer and returns all customers regardless of whether they made a purchase or not.
Hint
Remember to group your results to get counts.
Exercises
Total Questions
2
Estimated Time
4 min
Passing Score
70%
Instructions
- Read each question carefully
- You can use hints if you need help
- Complete all questions before submitting
4 more questions available
Enrol freeQuiz
Total Questions
2
Estimated Time
4 min
Passing Score
70%
Instructions
- Read each question carefully
- You can use hints if you need help
- Complete all questions before submitting
1 more question available
Enrol freeChallenge Problems
Total Questions
2
Estimated Time
4 min
Passing Score
70%
Instructions
- Read each question carefully
- You can use hints if you need help
- Complete all questions before submitting