OK, now that you know what the best salary is, let's discuss another function:
AVG(TotalSum) AS AvgTotalSum
WHERE CustomerId = 100;
AVG() function finds the average value of the specified column. In our example, we'll get the average order value for the customer with ID 100.
It is important to note that in SQL Server,
AVG() used on an integer will use integer division and return an integer. For example, the average of the four numbers 1, 2, 2, and 2 will be 1 (even though it's 1.75 with floating-point division). Keep that in mind when you use
AVG() on integer columns in SQL Server.