SQL Aggregate Functions – SQL Tutorial | Software Testing Material

SQL Aggregate Functions:

In this post, we see SQL Aggregate functions in detail.

SQL aggregate functions return a single value, calculated from values in a column.

AVG() – This functions returns the average value
COUNT() – This functions returns the number of rows
MAX() – This functions returns the largest value
MIN() – This functions returns the smallest value
ROUND() – This functions rounds a numeric field to the number of decimals specified
SUM() – This functions returns the sum

Let’s see one by one in detail.

SQL AVG() Syntax:


Here I have written two statements to show you the output of complete table and output of average runs.

Copy both the statements as mentioned in the below screenshot and execute it to see the results.

SQL Aggregate Functions Averge

SQL COUNT() Function:


SQL Aggregate Functions Count

SQL MAX() Function:

SQL MIN() Function:



SQL Aggregate Functions Max Min

SQL ROUND() Function:


Example: If the value is 250.55 and you want to show just 250 then you could pass decimals parameter as 0. Same way if you want to show 250.5 then you could pass decimals value as 1.

SQL SUM() Function:



SQL Aggregate Functions Sum

In the next tutorial, we will learn STRING FUNCTIONS in SQL

Check out the complete SQL Tutorial by clicking on below link:

SQL Tutorial – Complete

Sharing is caring.

Share on facebook
Share on twitter
Share on linkedin

Like This Post?

We have a lot more where that came from?

We only send really good stuff occasionally, promise.

Rajkumar SM

Leave a Comment

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

Share on facebook
Share on google
Share on twitter
Share on linkedin
Share on whatsapp

Recent Posts:

Scroll to Top
API Testing eBook