MySQLAggregate FunctionsAVG
SUM

AVGAggregate Functions

MIN

Returns the average.

Syntax

AVG(expr)

Example

Enter values below to update the example in real time.

category
price
avg_price
products
-- 카테고리별 평균 가격
SELECT category, ROUND(AVG(price), 2) AS avg_price
FROM products
GROUP BY category;