Math Functions

In SQL, math functions are built-in features which perform mathematical operations and complex calculations directly in database queries. This makes it possible to work with numerical data in SQL rather than extracting the data and processing it separately.

Below is a list of math functions that can be used in various SQL platforms:

Math Functions

ABS()
Returns the absolute value of a given number.
CEILING()
Rounds up a numeric value to the next highest integer.
FLOOR()
Rounds down a number to the nearest whole integer.
LOG()
Returns the natural logarithm of a given number.
POWER()
Returns the value of a number raised to the power of another number.
SQRT()
Returns the square root of a given number.

All contributors

Looking to contribute?

Learn SQL on Codecademy