Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

sql
power
communitycreator
math

What is POWER() in SQL?

Harris Amjad

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

The POWER() function calculates the value of the numberbase raised to the power of another numberexponent.

Figure 1 shows the mathematical representation of the POWER() function.

Figure 1: Mathematical representation of POWER() function

Syntax

POWER(baseNumber, exponent)

Parameters

The POWER() function requires two parameters:

  • A base number.
  • An exponent number.

Return value

POWER() returns the value of the base number raised to the exponent number.

Example

/*example showing how to use POWER(X)*/
-- positive: baseNumber positive: exponent
SELECT POWER(10, 2);
-- positive: baseNumber negative: exponent
SELECT POWER(0.25, -2);
-- neagtive: baseNumber positive: exponent
SELECT POWER(-10, 2);
-- neagtive: baseNumber negative: exponent
select POWER(-0.5, -1);

RELATED TAGS

sql
power
communitycreator
math

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring