How to Use the AVG Function in Microsoft Access SQL
It is of utmost importance that you should use the average function especially when using Microsoft Access SQL as this will aid you in taking average of multiple columns at the same time. With the use of average function, you can save a lot of time and most importantly, you can apply the function in SQL to multiple items. For instance, you can calculate the average salary of an employee through AVG function.
Instructions
-
1
Install Microsoft Access SQL
The first step is to buy the license of the program. For this, you must go to your nearest DVD store and ask the salesperson for it. You can also visit the official Microsoft website and purchase the software online. After you have obtained the license, you must install it in your computer and gain familiarity with its features. -
2
Open SQL
After you have gained familiarity with SQL, you must open the new file. Make sure that you have saved your previous work and try changes on the new file. In order to apply the desired function in SQL, you must type ‘Select AVG’ in the search bar. -
3
Select columns
After you have selected the average function, you must now select the column or columns that you wish to take the average of. It is important that the values of column should all be numeric otherwise SQL will not be able to take average.
Write the ‘name’ of the column after the average function.
Writing the column name without brackets will not help and you will not be able to execute the command. Therefore, it is necessary that you should write the name of the column in parenthesis.
For example, if you want to take average of salary, you should write “SELECT AVG (Salary)” and hit the ‘enter’ key. Here 'Salary' is the name of the column. -
4
Mention the path
After selecting the column, you must type ‘From’ and write the name of table which includes that particular column. Now, you must execute the query to get your answer.