This tutorial explains how to use the MySQL SQRT function with syntax and examples.
The MySQL SQRT function returns the square root of a number.
The syntax for the SQRT function in MySQL is:
SQRT( number )
A positive number used to calculate the square root.
The SQRT function can be used in the following versions of MySQL:
Let's look at some MySQL SQRT function examples and explore how to use the SQRT function in MySQL.
For example:
mysql> SELECT SQRT(25);
Output: 5
mysql> SELECT SQRT(26);
Output: 5.0990195135927845
mysql> SELECT SQRT(0);
Output: 0
mysql> SELECT SQRT(-9);
Output: NULL