Which function in SQL is used to return square root value of a number?

SQRT() function :

This function in SQL Server is used to return the square root of a specified positive number. For example, if the specified number is 81, this function will return 9.

Features :

  • This function is used to find the square root of a given number.
  • This function accepts only positive numbers.
  • This function also accepts fraction numbers.
  • This function always returns positive number.
  • This function use the formula
  • (a)1/2 = Returned value
  • where a is the specified number.

Syntax :

SQRT(number)

Parameter :

This method accepts a parameter as given below :

  • number : Specified positive number whose square root is going to be returned.

Returns :

It returns the square root of a specified positive number.

Example:

Getting the square root of the specified number 4.

SELECT SQRT(4);

Output :

2.0