AVG
An aggregate that returns the arithmetic mean of the non-NULL values in a group.
In more detail
It always returns a floating-point number in SQLite, even over integers, so format it for display outside the query. Because NULLs are skipped, the mean is over the values present, not over all rows.
Related terms
- aggregate function — A function that turns many input rows into one value, such as COUNT, SUM, AVG, MIN or MAX.
- SUM — An aggregate that adds up the non-NULL values in a group.
- floating-point number — A number with a fractional part stored in binary, which can only approximate most decimal values.
Taught in
- Aggregate Functions — PostgreSQL, Indexing & Relational Data Modeling
- Subqueries — PostgreSQL, Indexing & Relational Data Modeling