Bookmark Forum | Blog |

# SQL Tutorial >> SQL Functions.

Back             Next

In SQL Tutorial since we have started dealing with numbers, the next natural question to ask is if it is possible to do math on those numbers, such as summing them up or taking their average or multiplying them. The answer is yes! SQL has several arithmetic functions, and they are mentioned below

## List of Available SQL Fumctions

```- AVG    Average of any given values.

- COUNT  Counts the number or given values or records.

- MAX    Return the maximum value from the given multiple values.

- MIN    Returns the minimum value from the given number of values.

- SUM    Will return the sum of all provided values.
```

## Syntax for SQL Function

SELECT "function type"("column_name")
FROM "table_name"

Table of Employees_Salary

 FirstName Month Salary Austin January 1100\$ Creston January 1000\$ Kate January 1100\$ Angela January 1000\$

## Example of SQL Function

SELECT SUM(Salary) FROM Employees_Salary

Table of Employees_Salary

 SUM(Salary) 4200\$

\$4200 represents the sum of all Salary entries: \$1100 + \$1000 + \$1100 + \$1000.

## SQL String Functions

In addition to using SQL functions, it is also possible to use SQL to perform simple tasks such as addition (+) and subtraction (-) as required. For character-type data, there are also several SQL String Functions available, such as SQL Concatenation Function, SQL Trim Function, and SQL Substring functions. Different RDBMS vendors have different SQL string functions implementations, and it is best to consult the references for your RDBMS to see how these functions are used.

Back             Next

 [ About ] [ Contact ] [ Home ] [ Links ] [ Site Map ] [ Services ] [ Privacy ]
 Copyright © 2005 -  2019 www.globalguideline.com All rights reserved. (Best viewed in IE 6.0+ or Firefox 2.0+ at 1024 * 768 or higher) 96 visitors are online now