The SQRT function is an inbuilt function in PLSQL which is used to return the square root of the given input number.
SQRT( number )
This function accepts a parameters which are illustrated below:
number – This is the input number whose square root is going to be calculated.
This function returns a numeric number which is square root of the given input number.
Supported Versions of Oracle/PLSQL is given below:
- Oracle 12c
- Oracle 11g
- Oracle 10g
- Oracle 9i
- Oracle 8i
Let’s see some examples which illustrate the SQRT function:
DECLARE Test_Number number := 25; BEGIN dbms_output.put_line(SQRT(Test_Number number)); END;
In the above example, 5 is the square root of 25.
DECLARE Test_Number number := 5.617; BEGIN dbms_output.put_line(SQRT(Test_Number number)); END;
In the above example, 2.37002109695251 is the square root of 5.617
DECLARE Test_Number number := 9; BEGIN dbms_output.put_line(SQRT(Test_Number number)); END;
In the above example, 3 is the square root of 9
This function is used to calculate the square root of the given input number.
- PLSQL | ABS Function
- PLSQL | EXP Function
- PLSQL | LN Function
- PLSQL | TAN Function
- PLSQL | MOD Function
- PLSQL | CHR Function
- PLSQL | LOG Function
- PLSQL | SIN Function
- PLSQL | COS Function
- PLSQL | LEAST Function
- PLSQL | RPAD Function
- PLSQL | INITCAP Function
- PLSQL | LENGTHC Function
- PLSQL | REPLACE Function
- PLSQL | INSTRB Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.