반응형
Given the following table 'decimals':
** decimals table schema **
- id
- number1
- number2
Return a table with two columns (cuberoot, logarithm) where the values in cuberoot are the cube root of those provided in number1 and the values in logarithm are changed to the natural logarithm of those in number2.
Solution:
SELECT
CBRT(number1) as cuberoot,
LN(number2) as logarithm
FROM
decimals
The cube root is the CBRT function,
The natural logarithm can be found using the LN function.
Result:
cuberoot | logarithm |
15.883041847144092 | 8.029598276755332 |
14.695124005670634 | 7.949951736535845 |
8.586161784211237 | 7.443732089574755 |
9.265318579835226 | 8.36619019659569 |
11.131669954585497 | 8.169347418692219 |
15.89144564007865 | 6.933330006827099 |
7.856801233263617 | 8.141132932853179 |
반응형
'나는 이렇게 학습한다 > Algorithm & SQL' 카테고리의 다른 글
Easy SQL: Moving Values (0) | 2022.05.29 |
---|---|
Grasshopper - Terminal game move function (0) | 2022.05.29 |
Grasshopper - Check for factor (0) | 2022.05.26 |
SQL Basics: Maths with String Manipulations (0) | 2022.05.25 |
SQL Basics: Simple MIN / MAX (0) | 2022.05.24 |