The AVG()
function returns the average value of a set of values.
Figure 1 shows a visual representation of the AVG()
function.
AVG(column)
The AVG()
function takes a column or field as a parameter.
The AVG()
function returns the average value of a
This function ignores the
NULL
values in the column or field.
The following example shows how we can get the average of the student marks using the AVG()
function.
Student ID | Student Name | Student Marks |
1 | David | 22 |
2 | Luiss | 20 |
3 | Harvey | 15 |
4 | Lucy | 25 |
5 | Andrew | 10 |
select AVG(studentMarks) as averageStudentMarksfrom Students