Math Functions

nikolaspoczekaj's avatar
Published May 23, 2023
Contribute to Docs

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.
ACOS()
Returns the arccosine of a given angle.
ASIN()
Returns the arcsine of a number.
ATAN()
Returns the arctangent of a provided number.
CEILING()
Rounds up a numeric value to the next highest integer.
COS()
Returns the cosine of a given angle.
EXP()
Returns the value of e raised to the power of given number.
FLOOR()
Rounds down a number to the nearest whole integer.
LOG()
Returns the natural logarithm of a given number.
LOG10()
Calculates the base-10 logarithm of a number.
POWER()
Returns the value of a number raised to the power of another number.
SIN()
Returns the sine of an angle.
SQRT()
Returns the square root of a given number.
TAN()
Returns the tangent of an angle given in radians.

All contributors

Contribute to Docs

Learn SQL on Codecademy