Open In App

SQUARE() Function in SQL Server

SQUARE() function :
This function in SQL Server is used to return the square of a specified number. For example, if the specified number is 9, this function will return 81 as output.

Features :



Syntax :

SQUARE(number)

Parameter :
This method accepts a parameter as given below as follows.



Returns :
It returns the square of a specified number.

Example-1 :
Getting the result 16.0 which is the square of the specified number 4.

SELECT SQUARE(4);

Output :

16.0

Example-2 :
Getting the result 4.0 which is the square of the specified negative number -2.

SELECT SQUARE(-2);

Output :

4.0

Example-3 :
Getting the result 0.0 which is the square of the specified number zero (0).

SELECT SQUARE(0);

Output :

0.0

Example-4 :
Getting the result 1.0 which is the square of the specified number 1.

SELECT SQUARE(1);

Output :

1.0

Example-5 :
Getting the result 1.4399999999999999 which is the square of the specified number 1.2.

SELECT SQUARE(1.2);

Output :

1.4399999999999999

Application :
This function is used to return the square of a specified number.

Article Tags :
SQL