# Intro to SPARQL (Part4)

# Numerical operations using MAX, MIN, COUNT, SUM and AVG keywords.

These keywords are executing very basic operations regarding the numerical calculations. But, they can be used for more complex numerical operations in complex queries. They perform exactly the same function which is in the keyword itself.

- MAX gives the maximum of a given set of integer values.
- MIN gives minimum of a given set of integer values.
- COUNT counts number of triples returned.
- SUM gives the sum of a set of integer values.
- AVG gives the average of a set of integer values.

As the control example we have the result of the query without any of these operations. As you can see we have 3 caloric values.

## MAX

## MIN

## COUNT

## SUM

## AVG

What should keep in mind is, these queries may contain many other conditions ,ANDed to create complex queries. These are just simplest representations of each keyword created for better understanding of a beginner.

As the next part of this series I hope to describe about the GROUP BY and HAVING keywords.