SQRT Function in Oracle SQL – PLSQL

The SQRT function in Oracle SQL / PLSQL is used to get the square root of a number.

Syntax for the SQRT function in Oracle SQL / PLSQL is:

SELECT SQRT(n)
FROM table_name;

  • Here ‘n’ is a positive number whose square root is to be determined.

Example 1:

SELECT SQRT(9)
FROM DUAL; 

Will return “3” because 3*3 = 9


Example 2:

SELECT SQRT(16)
FROM DUAL; 

Will return “4” because 4*4 = 16


Example 3:

SELECT SQRT(2)
FROM DUAL; 

Will return “1.4142135623731” because 1.4142135623731 * 1.4142135623731 = 2


Example 4:

SELECT SQRT(45)
FROM DUAL; 

Will return “6.70820393249937” as 6.70820393249937 * 6.70820393249937 = 45


Tagged , , , , , , , , , , , . Bookmark the permalink.