SQL Average function


Average Function In SQL

Average function is used to display the average value of Numeric column in SQL
NOTE- for the AVG()function column should be numeric.

Avg() Syntax-The Basic Syntax For Average Function Are given Below

Average function Without Condition

SELECT AVG(column_name)FROM table_name;

Average function With Condition

SELECT AVG(column_name)FROM table_name WHERE condition;

Example of Average Function

SQL Query-
SELECT AVG(Marks)FROM Student;

In Above Example It Will Display The Total Average Of Marks Column in Student Table


Post a Comment