PI

PI is an SQL function that returns the value of (Pi), which is the mathematical constant with approximate value of 3.14159. It doesn't require any parameters.

PI()

Example

SELECT PI();

Output

3.141593

Explanation

The “PI()” statement in MySQL is a mathematical function that returns the value of PI up to the decimal precision supported by the system, which is approximated to 3.141593. No arguments are needed for this function.

PI()

Example

SELECT PI();

Output

3.141592653589793

Explanation

In this example, the PI() function is used, which returns the constant value of PI. In SQL Server, PI is calculated to a value of approximately 3.141592653589793.

PI()

Example

SELECT PI() FROM dual;

Output

3.14159265358979323846

Explanation

In Oracle SQL, the PI() function returns the value of Pi (approximately 3.14159). The SELECT PI() FROM dual; statement calls this function. dual is a special one-row, one-column table present by default in Oracle Database. It’s used for calculations that aren’t really associated with any table.

PI()

Example

SELECT PI();

Output

3.14159265358979

Explanation

The above code uses the PI function in SQLite to return the numeric value of Pi, which is approximately 3.14159265358979.

For in-depth explanations and examples SQL keywords where you write your SQL, install our extension.