totn MariaDB Functions

MariaDB: SQRT Function

This MariaDB tutorial explains how to use the MariaDB SQRT function with syntax and examples.

Description

The MariaDB SQRT function returns the square root of a number.

Syntax

The syntax for the SQRT function in MariaDB is:

SQRT( number )

Parameters or Arguments

number
A positive number used to calculate the square root.

Note

  • The SQRT function will return NULL, if the number is a negative value.

Applies To

The SQRT function can be used in the following versions of MariaDB:

  • MariaDB 10

Example

Let's look at some MariaDB SQRT function examples and explore how to use the SQRT function in MariaDB.

For example:

SELECT SQRT(49);
Result: 7

SELECT SQRT(50);
Result: 7.0710678118654755

SELECT SQRT(0);
Result: 0

SELECT SQRT(-1);
Result: NULL