Skip to content
SQLSimplified
numeric

POWER()

Raises a base to a specified exponent.

Description

POWER raises a base number to a given exponent (base ^ exponent). It's used for growth calculations, squaring values, and any exponential math. POWER(2, 3) is 8. The alias POW is also common.

Syntax

POWER(base, exponent)
POW(base, exponent)

Parameters

NameDescriptionOptional
baseThe value to exponentiate.No
exponentThe power to raise it to.No

Return Type

Returns a DOUBLE.

Examples

Store (Customers/Orders/Products)

Loading database engine...

Store (Customers/Orders/Products)

Loading database engine...

Square roots via exponent

POWER(x, 0.5) is the same as SQRT(x). Use fractional exponents for other roots.

Common Mistakes

  • Negative base with fractional exponent. This can produce a complex number and error in SQL, which only handles reals.
  • Integer overflow expectations. Results are DOUBLE; very large powers can overflow to infinity.
  • Confusing with multiplication. POWER(2, 3) is 8, not 6.

See also: SQRT, EXP, ABS.

Search

Search lessons, functions, examples, and practice problems