Simple statistics min max avg

suggest change

In order to determine some simple statistics of a value in a column of a table, you can use an aggregate function.

If your individuals table is:

Name Age
Allie 17
Amanda 14
Alana 20

You could write this statement to get the minimum, maximum, and average value. min and max of an integer column return integer. avg returns numeric.

SELECT min(age), max(age), avg(age)
FROM individuals;

Result:

min max avg
14 20 17

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents