Aggregate Functions in Action
In this section, we will work with the table below, named Person:

- The total number of customers (name of the column: NumOfCustomers)
- The date of the first and last order, based on the date ordered (name of the column: DateFirst & DateLast)
- The total average age of the customers (name of the column: AverageAge)
- The total number of items that were being ordered by all customers (name of the column: TotalItems)
TEXT/X-SQL
1SELECT COUNT(Price) AS NumOfCustomers, MIN(DateOfOrder) AS DateFirst, MAX(DateOfOrder) AS DateLast, AVG(Age) AS AverageAge, SUM(NumberOfItems) AS TotalItems
2FROM Person;
The resulting table would look like this:
