The EXP() function in SQL is a mathematical function used to return the value of the mathematical constant e raised to the power of a specified number.
- Useful in mathematical, statistical and financial calculations.
- Value of e is approximately 2.71828.
Syntax
EXP(number)- number: The exponent to which the constant e is raised.
Note: The EXP() function is supported by MySQL, SQL Server, PostgreSQL, Oracle and SQLite when SQLite math functions are enabled.
Working
Below are some examples of the EXP() function to understand how it is used with numeric values.
Example 1: Calculate EXP(1)
In this example, we will calculate the value of e raised to the power of 1.
Query:
SELECT EXP(1) AS exponential_value;Output:

Example 2: Calculate EXP(0)
In this example, we will calculate e raised to the power of 0.
Query:
SELECT EXP(0) AS exponential_value;Output:

Example 3: Use EXP() on a Table Column
Let us create a numbers table containing exponent values.

Now, we can use the EXP() function to calculate the exponential value of each number.
Query:
SELECT number_id,
exponent_value,
EXP(exponent_value) AS exponential_value
FROM numbers;
Output:

- Calculates e raised to the power of each value in the exponent_value column.
- Returns the results as exponential_value.