← Quiz: ER to Tables: all 15 questions
Quiz: ER to Tables · Question 14 of 15
In the phone-count query, why is COUNT(p.phone) used after the LEFT JOIN instead of COUNT()?
In the phone-count query, why is COUNT(p.phone) used after the LEFT JOIN instead of COUNT(*)?
- A.COUNT(*) is not allowed with GROUP BY
- B.For a student with no phones, COUNT(*) would count the NULL-filled row as 1; COUNT(p.phone) gives 0
- C.COUNT(p.phone) is faster
- D.They always give the same answer
Answer & explanation
Correct answer: For a student with no phones, COUNT(*) would count the NULL-filled row as 1; COUNT(p.phone) gives 0
COUNT(column) skips NULLs, so empty groups correctly show 0.
Can you get the rest right without peeking?
Take the timed Quiz: ER to Tables quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →