# Mathematical Functions in SQL

Mathematical functions are very important in SQL to implement different mathematical concepts in queries.

Some of the the major mathematical functions in SQL are as follows −

## ABS(X)

This function returns the absolute value of X. For example −

Select abs(-6);

This returns 6.

## MOD(X,Y)

The variable X is divided by Y and their remainder is returned. For example −

Select mod(9,5);

This returns 4.

## SIGN(X)

This method returns 1 if X is positive, -1 if it is negative and 0 if the value of X is 0. For example −

Select sign(10);

This returns 1.

## FLOOR(X)

This returns the largest integer value that is either less than X or equal to it. For example −

Select floor(5.7);

This returns 5.

## CEIL(X)

This returns the smallest integer value that is either more than X or equal to it. For example −

Select ceil(5.7);

This returns 6.

## POWER(X,Y)

This function returns the value of x raised to the power of Y  For example −

Select power(2,5);

This returns 32.

## ROUND(X)

This function returns the value of X rounded off to the whole integer that is nearest to it.  For example −

Select round(5.7);

This returns 6.

## SQRT(X)

This function returns the square root of X. For example −

Select sqrt(9);

This returns 3.

## ASIN(X)

This function accepts a Sin value as the input and returns the angle in radians.  For example −

Select asin(0);

This returns 0.

## ACOS(X)

This function accepts a Cos value as the input and returns the angle in radians. For example −

Select acos(1);

This returns 0.

## ATAN(X)

This function accepts a Tan value as the input and returns the angle in radians. For example −

Select atan(0);

This returns 0.

## SIN(X)

This function accepts an angle in radians as its parameter and returns its Sine value. For example −

Select sin(0);

This returns 0.

## COS(X)

This function accepts an angle in radians as its parameter and returns its Cosine value. For example −

Select cos(0);

This returns 1.

## TAN(X)

This function accepts an angle in radians as its parameter and returns its Tan value. For example −

Select tan(0);

This returns 0.