Instruction
Well done! Let's study one more example of this kind:
SELECT CustomerId, AVG(TotalSum) AS AvgCustomerTotal FROM Order GROUP BY CustomerId;
As you can see, we now have the function AVG(TotalSum), which will count the average order value for each customer.
Exercise
Find the average salary for each department in 2015. Name the column AvgDepartmentSalary.
Stuck? Here's a hint!
Type:
SELECT Department, AVG(Salary) AS AvgDepartmentSalary FROM Employee WHERE Year = 2015 GROUP BY department;



