AVG - Average in Teradata

In order to get the average value from a column in a table, AVG function can be used.

SELECT AVG(salary)
FROM tbl_employee;

Generally, AVG function will be used with GROUP BY clause to find the average value for each group.

SELECT AVG(salary), dept_id
GROUP BY dept_id;

In the above example, the average salary for every dept_id will be displayed.
Please note that since AVG function can act independently, we don't need to add it in GROUP BY clause.