Home » SQL Basics » In Built Functions » Using Aggregate Functions

Using Aggregate Functions

Using Aggregate Functions:
SQL has several arithematic functions:

• AVG: Average of the column.

• COUNT: Number of records.

• MAX: Maximum of the column.

• MIN: Minimum of the column.

• SUM: Sum of the column.

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

Example: 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.

Leave a Reply

Your email address will not be published. Required fields are marked *