Dbms
Dbms
AGGREGATIO
N
OPERATORS PRESENTED BY:
K.SRUTHI
227R1A0490
ECE-B
INTRODUCTION:
Aggregation operators
An aggregate operators in performs a calculation on
multiple values and returns a single summarizing value. SQL
provides many aggregate operators that include avg , count,
sum, min, max, etc. An aggregate function ignores NULL
values when it performs the calculation ,except for the count
function.
We often use aggregation functions with the GROUPBY and
HAVING clauses of the SELECT statement.
Various types of SQL aggregate
operators are:
Count()
Sum()
Avg ()
Min()
Max()
COUNT FUNCTION
The COUNT() function returns the number of rows in a database
table.
Syntax:
count(expression)
Example:
SUM FUNCTION
The SUM() function returns the total sum of a numeric column in a
database table.
Syntax:
sum(expression)
Example:
AVG FUNCTION
The AVG() function returns the average value of a numeric column
in a database table.
Syntax:
avg(expression)
Example:
MIN FUNCTION
The MIN() aggregate function returns the lowest value(minimum) in
a set of non NULL values.
Syntax:
min(expression)
Example:
MAX FUNCTION
The MAX() aggregate function returns the highest value(maximum)
in a set of non NULL values.
Syntax:
max(expression)
Example:
Advantages :
•Summarization: Aggregation functions provide a concise
summary of large datasets, making it easier to understand and
analyze the data.
•Simplicity: They simplify data analysis by condensing complex
information into a single value or a small set of values.