Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (55.6k points)

Can anyone explain aggregate functions in SQL?

1 Answer

0 votes
by (119k points)

An aggregate function is used to make calculations on multiple rows to form a single value. We use aggregate functions in select statements along with Group by and Having clauses. Some of the aggregate functions we commonly used are AVG(), COUNT(), SUM(), MAX(), and MIN().

The following is the syntax to use COUNT() function in SQL:

SELECT COUNT (Column_Name)
FROM TableName
WHERE condition(s);

The following is the syntax to use AVG () function in SQL:

SELECT AVG (ColumnName)
FROM TableName
WHERE condition(s);

The following is the syntax to use SUM () function in SQL:

SELECT SUM (ColumnName)
FROM TableName
WHERE condition(s);

If you are interested in SQL, then register for this SQL course by Intellipaat that provides instructor-led training, certification, and also job assistance.

Related questions

0 votes
1 answer
asked May 8, 2020 in SQL by Sudhir_1997 (55.6k points)
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
+3 votes
3 answers

Browse Categories

...