Database Management Systems (2130703)

BE | Semester-3   Summer-2018 | 05/23/2018

Q3) (b)

List and explain aggregation functions with suitable example.

Aggregate Function:-

  • Operation: It takes a more than one value as input and returns a single value as output
  • Symbol: G
  • Notation: G function (attribute) (relation)
  • Aggregate functions: Sum, Count, Max, Min, Avg.

Consider following table

 
Rno Name Dept CPI
101 Ramesh CE 8
108 Mahesh EC 6
109 Amit CE 7
125 Chetan CI 8
138 Mukesh ME 7
128 Reeta EC 6
133 Anita CE 9
 
Example: Find out sum of all students CPI.
 G sum (CPI) (Student)
 
Output: The above query returns sum of CPI.
 
sum
51
 
Example: Find out max and min CPI.
 G max (CPI), min (CPI) (Student)
 
Output: The above query returns sum of CPI.
 
max min
9 6