What are Aggregate functions in SQL

0
47

In database management an aggregate function is a function where the values of multiple rows are grouped together as input on certain criteria to form a single value of more significant meaning.

Various Aggregate Functions are as follows:

1) Count()

2) Sum()

3) Avg()

4) Min()

5) Max()

 

Count():

Count(*): Returns total number of records .i.e 6.
Count(salary): Return number of Non Null values over the column salary. i.e 5.
Count(Distinct Salary):  Return number of distinct Non Null values over the column salary .i.e 4

 

Sum():

sum(salary):  Sum all Non Null values of Column salary i.e., 310
sum(Distinct salary): Sum of all distinct Non-Null values i.e., 25

 

Avg():

Avg(salary) = Sum(salary) / count(salary) = 310/5
Avg(Distinct salary) = sum(Distinct salary) / Count(Distinct Salary) = 250/4

 

Min():

Min(salary): Minimum value in the salary column except NULL i.e., 40.
Max(salary): Maximum value in the salary i.e., 80.

Zoeken
Categorieën
Read More
Other
Interactive Pet Gear: Competitive Landscape in the Dog Treat Launcher Market
The global dog treat launcher market is undergoing a period of dynamic growth and innovation. The...
By Mayur Gunjal 2025-06-27 09:44:24 0
Drinks
Global Pretzels Market Twists Toward Growth with Flavor Innovations and Healthier Snacking Trends
"Executive Summary Pretzels Market : CAGR Value   Data Bridge Market Research...
By Komal Galande 2025-07-07 07:05:30 0
Other
Forensic Technologies Market Analysis and Outlook Report 2025-2034
The worldwide "Forensic Technologies Market" 2025 Research Report presents a professional and...
By Tushar Jane 2025-06-10 05:38:16 0
Other
Air Separation Plants – The Backbone of Industrial Gases Production
Air separation plants are crucial in producing high-purity gases, such as oxygen, nitrogen, and...
By Ananya Birla 2025-06-20 09:46:09 0
Other
Global Myxoma Market Overview: Growth, Share, Value, Size, and Scope
"Executive Summary Myxoma Market :  Myxoma market is expected to gain market...
By Shweta Kadam 2025-06-25 08:14:34 0
Omaada - A global social and professionals networking platform https://www.omaada.com