Skip to main content
PProfileMatch
← Path

SQL Fundamentals · SQL GROUP BY, HAVING and Aggregate Functions Explained with Examples

0 XP
  1. 1 current stop: learning
  2. 2 upcoming
  3. 3 upcoming
  4. 4 upcoming
  5. 5 upcoming

Finish after stop 5

Stop 1 of 5 · Library returns desk

Trick to keep in mind+3 XP

COUNT(*) counts rows; COUNT(col) counts values that exist.

Aggregates over a column skip NULLs, because NULL means there is no value to count. Take five rows where a column is NULL in two of them: COUNT(*) gives 5 and COUNT(col) gives 3. The two only agree when the column has no NULLs at all.

Read it once, then a question tests whether the trick stuck.