The AVG function calculates the arithmetic average of an expression with a single value. You can use any data type that can be added or divided by a number. The data type of the attribute to be averaged is maintained. For example, if the attribute is a floating point value, the AVG function also returns a FLOAT. You cannot get the average of a collection.
AVG ( [ DISTINCT | UNIQUE | ALL ] expression )
When calculating the average of a value specified in an expression, you can determine whether to include all instances or only unique values.
The following is an example that returns the average number of gold medals that Korea won in the Olympic Games from 1988 to 2004.
WHERE nation_code = 'KOR';
Result : 9