Skip to content

AVG

  • column_name: This parameter specifies the column of which the average will be calculated. In the AVG() function, this column should contain numeric type data because an average cannot be calculated on non-numeric types.
SELECT AVG(price)
FROM products;
| AVG(price) |
|------------|
| 45.00 |

The above SQL query calculates the average price of all products in the ‘product’ table. The AVG function adds up all prices and divides it by the number of prices to return the average.