Numeric Functions

  1. Overview
  2. MYSQL
  3. Numeric Functions

MySQL PI() Function

The PI() function is used to return the value of π (pi), a mathematical constant representing the ratio of a circle's circumference to its diameter. Syntax PI() Definit ...

MySQL MOD() Function

The MOD() function is used to calculate the remainder of one number divided by another. Syntax MOD(x, y) OR x MOD y OR x % y Definition and Usage The MOD() func ...

MySQL POW() Function

The POW() function calculates and returns the result of a base number raised to the power of an exponent. Syntax POW(x, y) Definition and Usage POW(x, y) computes xyx^y ...

MySQL LOG2() Function

The LOG2() function in MySQL calculates and returns the logarithm of a number to base-2. Syntax LOG2(number) Definition and Usage The LOG2() function is used to compute ...

MySQL RADIANS() Function

The RADIANS() function converts a degree value into radians. Syntax RADIANS(number) Definition and Usage The RADIANS() function is used to convert an angle from degrees ...

MySQL SIN() Function

The SIN() function is used to calculate the sine of a given angle (in radians). Definition and Usage The SIN() function returns the sine of a number, which is a trigonometric ...

MySQL SIGN() Function

The SIGN() function is used to determine the sign of a given number. Definition and Usage Returns 1 if the number is positive. Returns 0 if the number is zero. Returns -1 i ...

MySQL SQRT() Function

The SQRT() function in MySQL is used to return the square root of a given number. Definition and Usage The SQRT() function returns the square root of a number. The number mu ...

MySQL MAX() Function

The MAX() function is used to retrieve the maximum value from a set of values in a column or expression. Syntax MAX(expression) Definition and Usage The MAX() function ...

MySQL RAND() Function

The RAND() function generates a random decimal number. Definition and Usage Returns a random number between 0 (inclusive) and 1 (exclusive). If a seed value is provided, the ...

MySQL TAN() Function

The TAN() function in MySQL is used to calculate the tangent of a number. The number is expected to be in radians. Definition and Usage The TAN() function returns the tangent ...

MySQL MIN() Function

The MIN() function is used to retrieve the minimum value from a set of values in a column or expression. Syntax MIN(expression) Definition and Usage The MIN() function ...

MySQL POWER() Function

The POWER() function computes and returns the result of raising a base number to the power of an exponent. It is functionally identical to the POW() function. Syntax POWER(x, y ...

MySQL SUM() Function

The SUM() function in MySQL is used to calculate the total sum of a numeric column or expression. Definition and Usage The SUM() function calculates the sum of a set of value ...

MySQL TRUNCATE() Function

The TRUNCATE() function in MySQL is used to truncate a number to a specified number of decimal places without rounding the value. Definition and Usage The TRUNCATE() function ...

MySQL ATAN2() Function

The ATAN2() function calculates the arc tangent (inverse tangent) of two numbers, considering their signs to determine the appropriate quadrant of the resulting angle. Syntax A ...

MySQL COS() Function

The COS() function returns the cosine of a given number, which is expressed in radians. Syntax COS(number) Definition and Usage The COS() function computes the cosine o ...

MySQL COUNT() Function

The COUNT() function in MySQL is used to return the number of records (rows) in a specified column that are not NULL. It is often used to count the number of rows returned by a que ...

MySQL CEILING() Function

The CEILING() function, also known as CEIL(), returns the smallest integer value that is greater than or equal to the specified number. Syntax CEILING(number) Definition a ...

MySQL CEIL() Function

The CEIL() function, also known as CEILING(), returns the smallest integer value that is greater than or equal to the given number. Syntax CEIL(number) Definition and Usag ...

MySQL COT() Function

The COT() function returns the cotangent of a given number, which is expressed in radians. Syntax COT(number) Definition and Usage The COT() function computes the cotan ...

MySQL DIV Function

The DIV function is used in MySQL for integer division, which means the result will be the quotient without the remainder (i.e., it rounds down the result to the nearest integer ...

MySQL EXP() Function

The EXP() function in MySQL is used to calculate e raised to the power of a specified number. The constant e (approximately 2.718281...) is the base of the natural logarithms, and ...

MySQL FLOOR() Function

The FLOOR() function in MySQL is used to return the largest integer that is smaller than or equal to a given number. It effectively "rounds down" the number to the nearest integer, ...

MySQL LOG10() Function

The LOG10() function in MySQL is used to return the base-10 logarithm of a number. Syntax LOG10(number) Definition and Usage The LOG10() function calculates the logarit ...

MySQL AVG() Function

The AVG() function calculates the average (arithmetic mean) of a numeric column or expression. It ignores NULL values when computing the result. Syntax AVG(expression) Def ...

MySQL LOG() Function

The LOG() function in MySQL is used to return the logarithm of a specified number, either with the natural logarithm (base e) or with a specified base. Syntax LOG(number) or ...

MySQL DEGREES() Function

The DEGREES() function in MySQL is used to convert a value in radians to degrees. Syntax DEGREES(number) Definition and Usage The DEGREES() function converts the numeri ...

MySQL GREATEST() Function

The GREATEST() function in MySQL is used to return the greatest (largest) value from a list of arguments. It evaluates each argument and returns the one with the highest value. ...

MySQL LEAST() Function

The LEAST() function in MySQL is used to return the smallest (least) value from a list of arguments. It evaluates each argument and returns the one with the lowest value. Syntax ...

MySQL LN() Function

The LN() function in MySQL is used to return the natural logarithm (logarithm to the base e) of a number. Syntax LN(number) Definition and Usage The LN() function compu ...

MySQL ABS() Function

The ABS() function returns the absolute (non-negative) value of a numeric value, effectively removing any negative sign. Syntax ABS(number) Definition and Usage The ABS ...

MySQL ACOS() Function

The ACOS() function calculates the arc cosine (inverse cosine) of a given numeric value. Syntax ACOS(number) Definition and Usage The ACOS() function returns the arc co ...

MySQL ASIN() Function

The ASIN() function calculates the arc sine (inverse sine) of a given numeric value. Syntax ASIN(number) Definition and Usage The ASIN() function returns the arc sine o ...

MySQL ATAN() Function

The ATAN() function calculates the arc tangent (inverse tangent) of one or two numeric values. Syntax ATAN(number) or ATAN(a, b) Definition and Usage The ATAN() fun ...