Databases · Junior · Question 59 of 75
What does COALESCE(nickname, name) return?
- 1Both values joined together
- 2NULL if either value is NULL
- ✓Correct answer:
nicknameif it's not NULL, otherwisename
Explanation
COALESCE returns the first non-NULL argument. It's handy for defaults, e.g. COALESCE(SUM(amount), 0) when there are no rows.