SQLite AVG function
SQLite AVG function is used to retrieve the average value of an expression.
Syntax when you use AVG function with GROUP BY clause:
We have a table named "STUDENT", having the following data:
Retrieve the average fees of all students in "STUDENT" table.
Exampple2: Using DISTINCT clause with AVG function
Retrieve average distinct fees from "STUDENT" table where FEES is greater than 10000.
Example3: Using mathematical formula with AVG function
You can use mathematical formulae to retrieve an average value according to your requirement:
Example4: Using GROUP BY clause with AVG Function
Retrieve NAME and FEES from the table and GROUP BY the result by AGE: