Besides column data and calculated fields you can also display the results of aggregate functions on an SQL select statement. An aggregate function derives it value from an aggregation, or group, of values. For example, we might wish to sum the populations of major cities in California or display the average of the population of major cities in Florida.
To learn work with aggregate functions in a SQL select statement, follow these steps:
sumaggregate function accepts as its argument the column value we wish to sum across the selected rows. The selected rows form the group or aggregation.
avgaggregate function accepts as its argument the column value we wish to average across the selected rows. As before, the selected rows form the group or aggregation.