Multiple Row Functions
Multiple Row Functions
Multiple Row functions are also called Aggregate Functions because they summarize the results of a
query and return a single value calculated from all the values present in a column instead of providing
the listing of all of the rows.
The Aggregate functions are max(),min(),avg(),sum(),count(), count(*). We shall discuss one by one.
2.Avg():Find the average value of any column or expression based on the column.
1|Page
3.Max():Returns the highest/largest value among the given set of values of any column or expression
based on columns.
4.Min():Returns the lowest/smallest value among the given set of values of any column or expression
based on columns.
6.Count-Distinct:The keywords Distinct and Count can be used together to count the number of records
excluding duplicate values.
Sorting in SQL-Order By
The SQL Order By clause is used to sort data in ascending or descending order based on one or more
columns.
To display name, marks and date of birth sorted in ascending order of date of birth from student.
2|Page
To display name, marks and date of birth sorted in descending order of date of birth from student.
Group By
The group by clause can be used in a select statement to collect data across multiple records
and group the results by one or more columns.
Having Clause
3|Page