SQLite 3 reference · Math Functions

SQLite POWER() Function

Raise a number to a power, so power(2, 10) is 1024. pow() is another name for the same function.

SQLite 3 Since 3.35.0

Create a free account to save this page, take notes and track your progress. Sign in

Syntax

power(X, Y)  |  pow(X, Y)

Parameters

ParameterDescription
X The base.
Y The exponent.

Return value

A floating-point number.

Examples

Powers
SELECT power(2, 10) AS a, pow(9, 0.5) AS square_root;

Output

a | square_root
1024 | 3

Run this on your computer — see “Get Started” for setup.

Compound interest
SELECT round(1000 * power(1 + 0.05, 10), 2) AS after_10_years;

Output

after_10_years
1628.89

Run this on your computer — see “Get Started” for setup.

This is one of SQLite's built-in math functions, available since 3.35.0 when SQLite is compiled with SQLITE_ENABLE_MATH_FUNCTIONS (the default for the sqlite3 command-line tool and most language bindings). The in-browser SQLite on this site is built without them, so the examples show output from standard SQLite instead.

Version history

VersionChange
SQLite 3.35.0Added

In other languages

Was this page helpful?