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.

Pesquisar
Categorias
Leia Mais
Drinks
Advancing Diagnostics: Global Bone Marrow Biopsy Market Driven by Cancer Detection Demand
"Executive Summary Bone Marrow Biopsy Market : The expected CAGR of global bone marrow...
Por Komal Galande 2025-07-10 05:10:02 0
SEO
M-クロロベンズアルデヒド市場調査2025-2031:シェア、産業分析、最新動向、成長機会
QYResearch株式会社(所在地:東京都中央区)は、最新の調査資料「M-クロロベンズアルデヒド―グローバル市場シェアとランキング、全体の売上と需要予測、2025~2031」を2025年6月3...
Por Qyresearch Jasmine1 2025-06-30 06:44:22 0
Outro
Airlines Market Growth and Forecast Analysis 2034
Global Airlines Market: Industry Trends, Share, Size, Growth, Opportunity and Forecast...
Por Tushar Jane 2025-05-07 05:32:09 0
Outro
Pharmacy Automation Market outlook and future Growth Analysis up to 2034
The worldwide "Pharmacy Automation Market" 2025 Research Report presents a professional and...
Por Tushar Jane 2025-05-26 05:16:57 0
Omaada - A global social and professionals networking platform https://www.omaada.com