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 Name | Descriptions |
ABS | The function is used to get the absolute value or absolute positive value |
ACOS | This function is used to get the angle in radians, whose cosine is the specified float expression. It is also known as arccosine. |
ASIN | This function is used to get the angle in radians, whose cosine is the specified float expression. It is also known as arcsine. |
ATAN | This function is used to get the angle in radians, whose tangent is the specified float expression. It is also known as arctangent. |
ATN2 | This 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. |
CEILING | This function is used to get the smallest value, which is greater than or equal to the specified numeric expression or given value. |
COS | This function is used to get the trigonometric cosine value, l which is measured in radians in the given expression. |
COT | This function is used to get the trigonometric cotangent value, which is measured in radians in the given expression. |
DEGREES | This function is used to convert a specified radiant angle into a degree-based equivalent angle. |
EXP | This Function is used to get an exponential value of the given float expression |
FLOOR | This function is used to get the largest integer value, which is less than or equal to the given numeric expression. |
LOG | This 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 |
LOG10 | This function is used to get the base 10 logarithmic value of the given float expression |
PI | This function is used to get the constant value of PI, which is approximately equal to 3.14 |
POWER | This function is used to get the power of user-specified expression or value. |
RADIANS | This function is used to convert the given angle to a Radians-measured equivalent angle. |
RAND | This function is used to get the positive, and the value will be greater than or equal to 0.0 and less than 1 |
ROUND | This function is used to get the nearest numeric value, which is rounded to the specified length or precision. |
SIGN | This function is used to get the sign of the given expression that can be Positive (+), Negative (-), or Zero (0) |
SIN | This method returns the trigonometric SINE value in radians for the given angle. |
SQRT | This function is used to calculate the square root of a given number or value |
SQUARE | This function calculates the square of a specified value or an individual number |
TAN | This 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.