average()是MySQL的Math函数。此函数用于从给定表达式获取平均值。
AVG - 语法
select avg(aggregate_expression) from table_name [where condition];
AVG - 参数
aggregate_expression :这是获取平均值的列名称
table_name :这是用于获取记录的表。
条件 :这是可选的。它用于获取条件记录。
AVG - 返回值
此函数从给定表达式返回平均值。
AVG - Tables表

AVG - 例子1
select avg(marks) as "Total Marks" from table2;
输出 :

AVG - 例子2
select avg(marks) as "Total Marks" from table2 where marks>65;
输出 :

AVG - 例子3
select avg(DISTINCT marks) as "Total Marks" from table2 where marks>60;
输出 :