Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Quartz Aggregate Functions in SQL, SQL Tutorial

Related Tutorials


 
 

Share on Google+Share on Google+

Aggregate Functions in SQL, SQL Tutorial

Advertisement
This page discusses - Aggregate Functions in SQL, SQL Tutorial

Aggregate Functions

     

In this section we are going to illustrate aggregate function, with the help of which we can use many arithmetic operation like average, count, maximum and many more in SQL. They are briefly described and denoted by the keyword in the given below section.

AVG
COUNT
MAX
MIN
SUM

For all of the above given function the standard code syntax will be:

 

 

 

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

For example we just take a Employee table and use the aggregate function SUM on the field "Salary" to find out the total salary of the Employee table.

Table Employee:

emp_Name Salery Joining_Date
Amit 15000 Feb-05-2005
Chandan 25000 Feb-17-2005
Ravi 8000 Feb-25-2005
Vinod 7000 Feb-28-2005

To find out the total salary of the company's employee we should write the following code:

SELECT SUM (Salary) FROM Employee;

When we run the above query we will get the following result:

SUM(Salary)
55000
Advertisements

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: April 18, 2011

Related Tutorials

Discuss: Aggregate Functions in SQL, SQL Tutorial  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0
DMCA.com