Using Aggregate Functions

Using Aggregate Functions:

SQL has several arithematic functions:

• AVG:
Average of the column.

Number of records.

• MAX:
Maximum of the column.

• MIN:
Minimum of the column.

• SUM:
Sum of the column.

SELECT “column_name1”, “function type” (“column_name2”), “column_name3″,….”column_nameZ” FROM “table_name”

SELECT name, max(age) FROM employee

In the above example it only displays the employee record is the most elderly person in the employees table.

This website uses cookies.