SQL Mathematical Functions

The SQL Mathematical Functions allows us to perform basic math functionality. For instance, you can use Sql Server Mathematical functions to find the elementary exponential value, square root, floor, round, logarithmic, and trigonometric.

SQL Mathematical Functions

Apart from basic math operators, which we discussed in the Arithmetic Operators, there are standard and common SQL Math functions. These Mathematical functions allow you to manipulate the numerical data, which is crucial in the data processing.

The following table will show you the list of Mathematical Functions in SQL Server. So, please follow the links to view the tutorial on Math functions.

FunctionsDescription
ABSIt returns the Absolute value or absolute positive value.
ACOSIt will return the trigonometric Arc Cosine value of a given value.
ASINIt returns the trigonometric Arc Sine value of a given value.
ATANIt will return the trigonometric Arc Tangent value of a given value.
ATN2It is used to return the angle (in radius) from the X-Axis to the specified point (y, x)
CEILINGThis SQL Mathematical function returns the smallest number, which is greater than or equal to the specified expression.
COSIt is used to return the trigonometric Cosine of a given number.
COTIt is used to return the trigonometric Cotangent of a given number.
DEGREESIt is used to convert the specified radiant angle to an equivalent angle measured in Degrees.
EXPIt returns E raised to the power of a given value, Where E is Euler’s number, and it is approximately equal to 2.71828.
FLOORThis returns the largest integer value, which is less than or equal to the specified expression or given number.
LOGIt will calculate the natural logarithmic value of a given number with base E, where E is Euler’s number, which is equal to 2.71828.
LOG10It is used to calculate the base 10 logarithmic value of the given number.
PIThis SQL Mathematical function returns the Pie Value, which is approximately equal to 3.14
POWERIt is used to display the power of user-specified expression.
RADIANSIt is used to convert the specified Degrees angle to the equivalent angle measured in Radians.
RANDThis returns the positive, and the value will be greater than or equal to 0.0 and less than 1.0
ROUNDIt is used to round the specified expression or an individual number to the nearest numeric.
SIGNReturns the Sign of the given argument, and the result may be Positive (+), Negative (-), or Zero (0).
SINIt is used to return the trigonometric sine of a given number
SQRTIt finds the square root of a specified expression or an individual number
SQUAREIt is used to return the square of the specified expression or an individual number
TANIt returns the trigonometric Tangent of a given number

From the above specified SQL Mathematical functions, all the Arithmetic functions such as ABS, DEGREES, CEILING, FLOOR, POWER, SIGN, AND RADIANS return the result in the same data type as the input value.

Trigonometric and other functions, including SQL Server EXP, SQUARE, SQRT, LOG10, and LOG will CAST their input values to FLOAT data type and return the result as FLOAT value.