Databases · Junior · Question 15 of 75
What is the difference between COUNT(*) and COUNT(phone)?
- 1
COUNT(phone)counts distinct phone numbers - 2They always return the same number
- ✓Correct answer:
COUNT(*)counts all rows;COUNT(phone)counts only rows wherephoneis not NULL
Explanation
Aggregate functions ignore NULLs, except COUNT(*). AVG(score) also averages only non-NULL values.