From the course: MySQL Essential Training (2019)

Unlock this course with a free trial

Join today to access over 22,400 courses taught by industry experts.

Basic math

Basic math

- [Instructor] Simple functions are provided for basic mathematical purposes. For example, if you need the number Pi, you can use the Pi function. Internally, it's a full double precision value, and yet, it's returning a simple float here if I say plus zero point with 15 zeros. That will give me the full double precision value there. If I need an argument raised to a power, I can use the power function and this will take the number eight and raise it to the power of two or squared and eight squared, of course, is 64. You can take off those last two letters of power and just have pow and that's an alias that will work exactly the same. There's also, of course, square root, which is spelled SQRT, and if I take the square root of 64, of course, I'll get eight. If I want something other, like the fourth root, I need to use power for that, and I can take the fourth root of 4096 by passing it one over four, and that will give us eight. There's also a symbol function for getting pseudo…

Contents