What is PI() in SQL?

The PI() function returns the value of Pi.

Figure 1 shows a visual representation of the PI() function.

Figure 1: Visual representation of PI() function

Syntax

PI()

Parameter

The PI() function does not require a parameter.

Return value

The PI() function returns the value of Pi.

By default, the PI() function returns a value of Pi of up to 6 decimal places.

Code

-- simple PI() upto 6 decimal places
SELECT PI();
-- increase the number of decimal places to 10
SELECT PI() + 0.0000000000;