w3resource

Oracle SQRT() function

Description

This function is used to get the square root of a given non-negative number.

Uses of Oracle SQRT() Function
  • Calculate the square root of a positive number: Obtain the square root value for various mathematical and engineering computations.

  • Perform geometric calculations: Utilize the function in geometry for calculations involving the lengths of sides in right-angled triangles.

  • Graphing and plotting: Generate graphs and plots that require square root calculations.

  • Scientific computations: Conduct scientific research and analyses that involve square root operations.

  • Data analysis: Analyze data sets where square root transformations are needed for normalization or other purposes.

Syntax:

SQRT(X)

Where X is a number

Pictorial Presentation of SQRT() function

Pictorial Presentation of Oracle SQRT() function

Example: SQRT() function

SELECT SQRT(25) FROM dual;

Here is the result.

  SQRT(25)
----------
         5

The above statement will return the square root of the given number 25.

Example: SQRT() function using negative value

SELECT SQRT(-25) FROM dual;

Here is the result.

SELECT SQRT(-25) FROM dual
            *
ERROR at line 1:
ORA-01428: argument '-25' is out of range

The above statement will return an error message because the value of the argument (-25) is negative.

Previous: SINH
Next: TAN



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://w3resource.com/oracle/oracle-numeric-functions/oracle-sqrt-function.php