SQL Server Mathematical functions

SQL Server provides several mathematical functions that allow you to perform mathematical calculations on numeric data. These functions operate on numeric values and return a single result. Here are some commonly used SQL Server mathematical functions:

Function NameDescriptions
ABSThe function is used to get the absolute value or absolute positive value
ACOSThis function is used to get the angle in radians, whose cosine is the specified float expression.  It is also known as arccosine.
ASINThis function is used to get the angle in radians, whose cosine is the specified float expression.  It is also known as arcsine.
ATANThis function is used to get the angle in radians, whose tangent is the specified float expression.  It is also known as arctangent.
ATN2This function is used to get the angle (in radians) from the X-Axis to the specified point (y, x).  Here, x and y are the two float expression. 
CEILINGThis function is used to get the smallest value, which is greater than or equal to the specified numeric expression or given value.
COSThis function is used to get the trigonometric cosine value, l which is measured in radians in the given expression.
COTThis function is used to get the trigonometric cotangent value, which is measured in radians in the given expression.
DEGREESThis function is used to convert a specified radiant angle into a degree-based equivalent angle.
EXPThis Function is used to get an exponential value of the given float expression
FLOORThis function is used to get the largest integer value, which is less than or equal to the given numeric expression.
LOGThis function is used to get the natural logarithm of the given float expression with base E, Where E is Euler’s number which is equal to 2.71828
LOG10This function is used to get the base 10 logarithmic value of the given float expression
PIThis function is used to get the constant value of PI, which is approximately equal to 3.14
POWERThis function is used to get the power of user-specified expression or value.
RADIANSThis function is used to convert the given angle to a Radians-measured equivalent angle.
RANDThis function is used to get the positive, and the value will be greater than or equal to 0.0 and less than 1
ROUNDThis function is used to get the nearest numeric value, which is rounded to the specified length or precision.
SIGNThis function is used to get the sign of the given expression that can be Positive (+), Negative (-), or Zero (0)
SINThis method returns the trigonometric SINE value in radians for the given angle.
SQRTThis function is used to calculate the square root of a given number or value
SQUAREThis function calculates the square of a specified value or an individual number
TANThis function is used to get the radian value of the trigonometric tangent of the given angle.

These are just a few examples of the mathematical functions available in SQL Server. Each function has specific syntax and usage requirements, which can be found in the SQL Server documentation for the corresponding version of the software.

Leave a Reply

Your email address will not be published. Required fields are marked *