The SQL Average function is an easy function to use.
Let’s take a look at the Employee table:
select * from employee;
Results:
If I want to find the average of the salary column, I would write the following query:
select avg(salary) as average_salary from employee;
With the following results:
Notice how we only get one column returned because that is all we asked for.
You can use the SQL Average on any numeric column using this technique.
When we get to the Group By clause, you will see how we can average across different groups of columns.
Leave a Question, Comment, or Reply. All are welcome!