SQL SQRT()

Sriparno08's avatar
Published Jun 2, 2023Updated Jun 10, 2025
Contribute to Docs

SQRT() is a function in SQL that returns the square root of a number input. The square root of any given number is a value that multiplied by itself will result in the passed number.

  • In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.
    • Beginner Friendly.
      5 hours

Syntax

SQRT(number);

number in this case should be any positive integer. For example, 144 as seen below.

Example

The square root of 144 is 12, as 12 multiplied by 12 equals 144. It is important to note, SQRT() requires a positive number, and will always return a positive number.

SELECT SQRT(144);

Yields:

12

Note: SQRT() is compatible with different SQL database platforms such as MySQL, PostgreSQL, Oracle, and SQL Server.

All contributors

Contribute to Docs

Learn SQL on Codecademy

  • In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.
    • Beginner Friendly.
      5 hours