SQL SQRT() Function

SQL SQRT() function return the square root of the n number. SQRT function return the real number.

If n number is a NUMBER data type then n number can't negative number.
If n number is a BINARY_FLOAT and BINARY_DOUBLE data type and if:

  • n > 0 return positive value
  • n = 0 return 0 value
  • n = -0 return -0 value
  • n < 0 return NaN

Supported Oracle SQL Version

  • Oracle 8i
  • Oracle 9i
  • Oracle 10g
  • Oracle 11g
  • Oracle 12c
  • Oracle 18c

Syntax

SQRT(n)

Example

Consider following example take n number, return the square root of the number.

SQL> SELECT SQRT(10) "SQRT" FROM DUAL;

      SQRT
----------
3.16227766

SQL> SELECT SQRT(16) "SQRT" FROM DUAL;

      SQRT
----------
         4

SQL> SELECT SQRT(25) "SQRT" FROM DUAL;

      SQRT
----------
         5