MySQL EXP Function

Example

Return e raised to the power of 1:

SELECT EXP(1);

Definition and Usage

The EXP() function returns e raised to the power of the specified number.

The constant e (2.718281…), is the base of natural logarithms.

Tip: Also look at the LOG() and LN() functions. Continue reading MySQL EXP Function

MySQL DIV Function

Example

Integer division (10/5):

SELECT 10 DIV 5;

Definition and Usage

The DIV function is used for integer division (x is divided by y). An integer value is returned. Continue reading MySQL DIV Function

MySQL DEGREES Function

Example

Convert the radian value into degrees:

SELECT DEGREES(1.5);

Definition and Usage

The DEGREES() function converts a value in radians to degrees.

Note: See also the RADIANS() and PI() functions. Continue reading MySQL DEGREES Function

MySQL COUNT Function

Example

Return the number of products in the “Products” table:

SELECT COUNT(ProductID) AS NumberOfProducts FROM Products;

Definition and Usage

The COUNT() function returns the number of records returned by a select query.

Note: NULL values are not counted. Continue reading MySQL COUNT Function

MySQL COS Function

Example

Return the cosine of a number:

SELECT COS(2);

Definition and Usage

The COS() function returns the cosine of a number. Continue reading MySQL COS Function

MySQL CEILING Function

Example

Return the smallest integer value that is greater than or equal to 25.75:

SELECT CEILING(25.75);

Definition and Usage

The CEILING() function returns the smallest integer value that is bigger than or equal to a number.

Note: This function is equal to the CEIL() function. Continue reading MySQL CEILING Function

MySQL CEIL Function

Example

Return the smallest integer value that is greater than or equal to 25.75:

SELECT CEIL(25.75);

Definition and Usage

The CEIL() function returns the smallest integer value that is bigger than or equal to a number.

Note: This function is equal to the CEILING() function. Continue reading MySQL CEIL Function

MySQL AVG Function

Example

Return the average value for the “Price” column in the “Products” table:

SELECT AVG(Price) AS AveragePrice FROM Products;

Definition and Usage

The AVG() function returns the average value of an expression.

Note: NULL values are ignored. Continue reading MySQL AVG Function

MySQL ATAN2 Function

Example

Return the arc tangent of two values:

SELECT ATAN2(0.50, 1);

Definition and Usage

The ATAN2() function returns the arc tangent of two numbers.

Syntax

ATAN2(a, b)

Continue reading MySQL ATAN2 Function