Showing entries 1 to 1
Displaying posts with tag: Quadratic Formula (reset)
Math with MySQL

I thought I posted this long ago... oh well....

We all know that math is the fundamental aspect of all life and the common language used around the world if not beyond. MySQL, like all databases, can help you with numerous aspects of math.

Here is a list of the functions: https://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html

Here are some simple examples to get you started. 

  • The Quadratic Formula  ax^2 + bx + c = 0


# 2x^2  – 4x – 3 = 0.
SET @a=  1;
SET @b=  3;
SET @c= -4;
SET @XX = ( -(@b) - SQRT(  POW(@b,2)  -4 * @a * @c) / POW(@a,2) ) ;
SET @YY = ( -(@b) + SQRT(  POW(@b,2)  -4 * @a * @c) / POW(@a,2) ) ; 
SET @XXX = MOD(@YY, @XX);

[Read more]
Showing entries 1 to 1