Lesson 2.1 · Pro
COUNT, SUM, AVG: summarise a table
Turn many rows into one number, and know exactly how each function treats NULL.
In this lesson
- Count rows with COUNT(*)
- COUNT(column) skips NULLs
- Count different values with COUNT(DISTINCT)
- SUM, AVG, MIN and MAX
- SUM of nothing is NULL, not 0
- AVG skips NULLs too
Go Pro to read this lesson
Pro unlocks every lesson and practice problem in SQL, Python, pandas and NumPy, with answers and step-by-step explanations.