← Quiz: SQL Interview Queries: all 10 questions
Quiz: SQL Interview Queries · Question 2 of 10
After departments LEFT JOIN employees, which gives 0 (not 1) for a department with no employees?
After departments LEFT JOIN employees, which gives 0 (not 1) for a department with no employees?
- A.COUNT(*)
- B.COUNT(e.emp_id)
- C.SUM(1)
- D.COUNT(d.dept_id)
Answer & explanation
Correct answer: COUNT(e.emp_id)
The unmatched row has NULL in e.emp_id, and COUNT(column) skips NULLs.
Can you get the rest right without peeking?
Take the timed Quiz: SQL Interview Queries quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →