What does it do? Calculates an average and rounds it to 4 decimals.
SQL> select sum(sal) sum_salary,
2 count(*) num_of_employees,
3 --
4 sum(sal) / count(*) average_salary,
5 --
6 round(sum(sal) / count(*), 4) rounded_avg_salary
7 from emp;
SUM_SALARY NUM_OF_EMPLOYEES AVERAGE_SALARY ROUNDED_AVG_SALARY
---------- ---------------- -------------- ------------------
29025 14 2073,21429 2073,2143
sum_salary
is sum of all salaries in the table
num_of_employees
is number of employees
average_salary
, as sum_salary
divided by num_of_employees
rounded_avg_salary
is what "your" code does
Note that we usually do it as
SQL> select avg(sal) from emp;
AVG(SAL)
----------
2073,21429