Provide the mean value of the “Price” column within the “Products” table.
SELECT AVG(Price) AS AveragePrice FROM Products; |
The AVG() function calculates the average value of an expression.
Note: excluding NULL values from consideration.
AVG(expression) |
Parameter |
Description |
expression |
Necessary: A numerical value (which may be a field or a formula) |
Works in: | From MySQL 4.0 |
Retrieve the entries with prices exceeding the average price.
SELECT * FROM Products WHERE Price > (SELECT AVG(Price) FROM Products); |