Back

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

Can anyone tell me how to use sum function in SQL?

1 Answer

0 votes
by (119k points)

SUM () function is an aggregate function that returns the sum of a set of values. The following is the syntax to use the SUM () function:

SELECT SUM (column_name)
FROM table_name
WHERE condition(s);

Here is the query to calculate the sum of salaries of employees whose location is ‘Bangalore’:

SELECT SUM (salary)

FROM Employee

WHERE location = ‘Bangalore’;

In order to learn SQL from top experts, you can register for this SQL training course by Intellipaat that provides instructor-led training, and also certification.

Related questions

0 votes
0 answers
asked Jan 7, 2021 in SQL by A R Sagar (120 points)
0 votes
1 answer
asked Dec 30, 2020 in SQL by Appu (6.1k points)
0 votes
1 answer
0 votes
1 answer

Browse Categories

...