Some of the methods that Query Builder provides are:
- count()
- max()
- min()
- avg()
- sum()
In Laravel’s query builder, there are several aggregate methods available for performing operations on database queries. Some of the most commonly used aggregate methods include:
count
: Used to retrieve the count of records from a table.sum
: Retrieves the sum of a given column’s values.avg
: Calculates the average of a given column’s values.min
: Retrieves the minimum value of a given column.max
: Retrieves the maximum value of a given column.
These aggregate methods can be applied to query builder instances to perform various calculations and operations on the database data.