Description:

  • Returns the average value of _`expr`_. The DISTINCT option can be used to return the average of the distinct values of expr.
  • If there are no matching rows, AVG() returns NULL. The function also returns NULL if expr is NULL.
  • This function executes as a window function if over_clause is present. over_clause is as described in Section 12.20.2, “Window Function Concepts and Syntax”; it cannot be used with DISTINCT.
  •   SELECT student_name, AVG(test_score)
             FROM student
             GROUP BY student_name;
             ```