나는 이렇게 학습한다/Algorithm & SQL

SQL Basics: Raise to the Power

daco2020 2022. 6. 9. 21:36
반응형

Given the following table 'decimals':

decimals table schema

  • id
  • number1
  • number2

Return a table with a single column result which is the output of number1 raised to the power of number2.

 

 

Solution:

SELECT 
  POWER(number1, number2) as result  
FROM 
  decimals

The 'POWER' function returns the value raised to the power of the first argument by the second argument.

 

 

반응형

'나는 이렇게 학습한다 > Algorithm & SQL' 카테고리의 다른 글

Opposite number  (0) 2022.06.11
SQL with LOTR: Elven Wildcards  (0) 2022.06.10
BASICS: Length based SELECT with LIKE  (0) 2022.06.08
SQL Basics: Repeat and Reverse  (0) 2022.06.07
SQL Basics - Position  (0) 2022.06.06