PI
Example
Section titled “Example”SELECT PI();Output
Section titled “Output”3.141593Explanation
Section titled “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.
Example
Section titled “Example”SELECT PI();Output
Section titled “Output”3.141592653589793Explanation
Section titled “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.
Example
Section titled “Example”SELECT PI() FROM dual;Output
Section titled “Output”3.14159265358979323846Explanation
Section titled “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.
Example
Section titled “Example”SELECT PI();Output
Section titled “Output”3.14159265358979Explanation
Section titled “Explanation”The above code uses the PI function in SQLite to return the numeric value of Pi, which is approximately 3.14159265358979.