SQL Functions, SQL Tutorial, Global Guide Line Technology.
Bookmark Bookmark: SQL Functions, SQL Tutorial Forum | Blog |

      Home                    

Basic SQL Guide.           
SQL Introduction.               
 What is Table?                  
 SQL Create Table.            
 SQL Insert Statement.      
 SQL Select Keyword.        
 SQL Order by clause.        
 SQL Count Statement.      
 SQL Group By Clause.      
 SQL Having Clause.          
 SQL Alias Tables.             
 SQL Join Tables.              
 SQL Outer Join.               
 SQL Update Statement.   
 SQL Delete Statement.    
 SQL Distinct Keyword.      
 SQL Where Keyword.       
 SQL And Or Keyword.      
 SQL In Keyword.              
 SQL Between Keyword.   
 SQL Like Keyword.          
 SQL Functions.
 SQL Concatenate.           
 SQL Substrings.               
 SQL Trim Function.         
 SQL Constraints.              
 SQL Primary Key.            
 SQL Foreign Key.            
 SQL Create Views.           
 SQL Create Index.           
 SQL Alter Table.             
 SQL Drop Table.             
 SQL Truncate Table.      
 SQL Summary.                

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 -  2018 www.globalguideline.com All rights reserved. (Best viewed in IE 6.0+ or Firefox 2.0+ at 1024 * 768 or higher) 225 visitors are online now