The MySql provides us with various for wide use for handling the database. The AVG() function is also one of the important function used in MySql. The AVG() is used to calculate the average value of the columns.
Syntax:
SELECT AVG(column-name) FROM table-name;
EXAMPLE:
Now with the following statement we will be able to calculate the average price:
SELECT AVG(Price) AS PriceAverage FROM Products;
It will produce the following output:
PriceAverage
28.866363636363637
0 Comment(s)