Skip to content
SQLSimplified
numeric

SQRT()

Returns the square root of a non-negative number.

Description

SQRT returns the square root of a number — the value that, multiplied by itself, gives the original. SQRT(16) is 4. It's handy for standardizing variances or geometric calculations.

Syntax

SQRT(expression)

Parameters

NameDescriptionOptional
expressionA non-negative numeric column or expression.No

Return Type

Returns a DOUBLE.

Examples

Store (Customers/Orders/Products)

Loading database engine...

Store (Customers/Orders/Products)

Loading database engine...

SQRT vs POWER

SQRT(x) is identical to POWER(x, 0.5). Use whichever reads better.

Common Mistakes

  • Negative input. SQRT of a negative number errors (no imaginary numbers in SQL). Guard with ABS or a WHERE if needed.
  • Expecting an integer. The result is a DOUBLE, often with decimals.
  • Confusing with squaring. SQRT(9) is 3, the inverse of POWER(3, 2).

See also: POWER, ABS.

Search

Search lessons, functions, examples, and practice problems