The SQL AVG aggregate function is used to calculate the average values of the column.

The SQL AVG syntax is simple and looks like this:

SELECT AVG ( [COLUMN NAME] ) FROM [TABLE NAME]


EXAMPLE :

Let's try it out with a simple example which is return average of the scores in the table.

Table GameScores

PlayerNameDepartmentScores
JasonIT3000
IreneIT1500
JaneMarketing1000
DavidMarketing2500
PaulHR2000
JamesHR2000

SQL statement :

SELECT AVG(Scores) FROM GameScores

Result:

AVG(Scores)
2000