0% found this document useful (0 votes)
13 views9 pages

Aggregate Functions

The document provides an overview of aggregate functions in DBMS, including Min, Max, Sum, Count, and Avg. Each function is explained with its purpose, syntax, and an example query. Additionally, it includes a sample dataset and SQL query results demonstrating the use of these aggregate functions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views9 pages

Aggregate Functions

The document provides an overview of aggregate functions in DBMS, including Min, Max, Sum, Count, and Avg. Each function is explained with its purpose, syntax, and an example query. Additionally, it includes a sample dataset and SQL query results demonstrating the use of these aggregate functions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Aggregate Functions

Presented By:
Name of the Student: M
John Phinni
Pin number:23551A4277
Department: CSE
Lecture Details:
Specialization: AI&ML
Topic Name College : GIET(A)
Subject/Branch, Semester, Any other information if any
TYPES OF AGGREGATE FUNCTIONS IN
DBMS
• Min(Minimum value)

• Max(Maximum value)

• Sum(Addition)

• Count(no of rows)

• Avg(Average of the row)


MIN(MINIMUM VALUE)
• Min is one of the aggregate function in the DBMS.

• It is used to find the minimum value among all the values in the
numeric column.

Syntax:-
select min(column name) from table name;
Example:-
select min(marks) from student;
MAX(MAXIMUM VALUE)
• Max is one of the aggregate function in the DBMS.

• It is used to find the maximum value among all the values in the
numeric column.

Syntax:-
select max(column name) from table name;
Example:-
select max(marks) from student;
SUM(ADDITION )
• Sum is one of the aggregate function in the DBMS.

• It is used to find the addition all the values in the numeric


column.

Syntax:-
select sum(column name) from table name;
Example:-
select sum(marks) from student;
AVG(AVERAGE)
• Avg is one of the aggregate function in the DBMS.

• It is used to find the average of all the values in the numeric


column.

Syntax:-
select avg(column name) from table name;
Example:-
select avg(marks) from student;
COUNT
• count is one of the aggregate function in the DBMS.

• It is used to count the number of values that are present in a


single column .

Syntax:-
select count(column name) from table name;
Example:-
select count(marks) from student;
ID NAME BRANCH MARKS
------- ---------- ------------ -------
100 lucky csm 100
101 giri cse 98
102 sai cyber 80
103 siddu aiml 78
104 aditya csd 89
105 kalyan ece 86
106 john eee 99

7 rows selected.
SQL> select min(marks) from student;
SQL> select avg(marks) from
MIN(MARKS) student;
----------
78 AVG(MARKS)
----------
SQL> select max(marks) from student; 90
MAX(MARKS)
SQL> select count(name) from
---------- student;
100
SQL> select sum(id) from student;
COUNT(NAME)
SUM(ID)
-----------
---------- 7

You might also like