# sqrt

> For the complete documentation index, see [llms.txt](https://docs.redpanda.com/llms.txt). Component-specific: [cloud-data-platform-full.txt](https://docs.redpanda.com/cloud-data-platform-full.txt)

---
title: sqrt
latest-operator-version: v26.1.4
latest-console-tag: v3.7.3
latest-connect-version: 4.93.0
latest-redpanda-tag: v26.1.9
docname: sql/sql-functions/math-functions/sqrt
page-component-name: cloud-data-platform
page-version: master
page-component-version: master
page-component-title: Cloud
page-relative-src-path: sql/sql-functions/math-functions/sqrt.adoc
page-edit-url: https://github.com/redpanda-data/cloud-docs/edit/main/modules/reference/pages/sql/sql-functions/math-functions/sqrt.adoc
description: The `sqrt()` function returns the square root of a given positive number.
page-topic-type: reference
page-git-created-date: "2026-05-26"
page-git-modified-date: "2026-05-26"
---

<!-- Source: https://docs.redpanda.com/cloud-data-platform/reference/sql/sql-functions/math-functions/sqrt.md -->

The `sqrt()` function returns the square root of a given positive number.

## [](#syntax)Syntax

The syntax for the `sqrt()` function in Redpanda SQL is:

```sql
SQRT(x)
```

The `sqrt()` function requires one argument:

-   `x`: A positive number or an expression that evaluates to a positive number.


## [](#examples)Examples

### [](#sqrt-a-positive-value)`sqrt()` a positive value

This example demonstrates how to find the square root of a positive integer with `sqrt()`:

```sql
SELECT SQRT(81);
```

The returned result:

```sql
+-----+
| f   |
+-----+
| 9   |
+-----+
```

### [](#sqrt-with-an-expression)`sqrt()` with an expression

This example shows how to use the `sqrt()` function to find the square root of the result of an expression:

```sql
SELECT SQRT(60 + 4);
```

The result of this statement is the square root of 64:

```sql
+-----+
| f   |
+-----+
| 8   |
+-----+
```

### [](#sqrt-with-double-precision-result)`sqrt()` with double precision result

In addition to integers, Redpanda SQL also supports calculating square roots with floating-point numbers as the outcome, as shown in this example:

```sql
SELECT SQRT(70);
```

The output of this statement is 8.3666, which is the square root of 70 with double precision:

```sql
+----------+
| f        |
+----------+
| 8.3666   |
+----------+
```

### [](#sqrt-a-negative-number)`sqrt()` a negative number

This example demonstrates how attempting to use the `sqrt()` function with a negative value returns an error:

```sql
SELECT SQRT(-25);
```

As the `sqrt()` function only accepts positive numbers, it returns a **_NaN (Not a Number)_** result for the square root of -25:

```sql
+-------+
| f     |
+-------+
| NaN   |
+-------+
```

### [](#sqrt-operator-x)SQRT operator (`|/(x)`)

This example uses the SQRT operator (`|/(x)`) to calculate the square root of a number:

```sql
SELECT |/(169) AS sqrt_operator;
```

This example calculates the square root of 169 using the SQRT operator. The result of this query will be:

```sql
 sqrt_operator
---------------
            13
```