SQLite sqrt() Function

The SQLite sqrt() function returns the square root of a given number.

Syntax

Here is the syntax of the SQLite sqrt() function:

sqrt(numeric_value)

Parameters

numeric_value

Required. a number.

Return value

The SQLite sqrt(numeric_value) function returns numeric_value the .

The SQLite sqrt() function will return NULL if the parameter is NULL, negative, or non numeric.

Examples

This example shows the basic usage of the SQLite sqrt() function:

SELECT
    sqrt(4),
    sqrt(9),
    sqrt(2);
sqrt(4) = 2.0
sqrt(9) = 3.0
sqrt(2) = 1.4142135623731