| Function | Result |
|---|---|
| SUM( {expr | DISTINCT col} ) | The sum of the values in the column. |
| AVG( {expr | DISTINCT col} ) | The average value in the column. |
| MIN(expr) | The minimum value in the column. |
| MAX(expr) | The maximum value in the column. |
| COUNT(DISTINCT col) | Counts all non-NULL values in a column. |
| COUNT(*) | Counts number of rows, regardless of NULL values. |
Students table from the
University Database.
/* Compute average GPA for all students */
SELECT 'Average GPA', AVG(stu_gpa)
FROM Students;