TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

MySQL Math

MySQL Math Functions with Examples for beginners and professionals on mysql math function, mysql tutorial, mysql string, examples, function, abs(), acos(), sign(), sin(), sqrt(), sum(), tan(), truncate, floor(), cos() etc.

<< Back to MYSQL

MYSQL Math functions

MySQL provides a wide range of functions which serves a wide range of arithmetical purposes. The following table indicates each of the functions with a brief description:

Functions Description
ABS() The ABS() function returns the absolute value of the specified number.
ACOS() The ACOS() function is used to get the arc cosine of the given number.
SIGN() The SIGN() function is used to get a sign of the specified number.
SIN() The SIN() function is used to get the sine value of the given number.
SQRT() The SQRT() function is used to get the square root of the given number.
SUM() This function is used to sum the values of given expressions.
TAN() The TAN() function is used to get the tangent of the given number
TRUNCATE() The TRUNCATE() function is used to get the given number truncated up to given certain decimal places.
ASIN() The ASIN() function is used to get the arc sine of the given number.
ATAN2() The ATAN2 function is used to get the arc tangent of the specified numbers n and m.
ATAN() The ATAN() function is used to get the arc tangent of the specified number.
AVG() The AVG() function is used to get the average value from the given expression.
CEIL() The CEIL() function returns the smallest value which is greater than or equal to the specified number.
CEILING() The CEILING() function returns the smallest value which is greater than or equal to the given number.
COS() The COS() function is used to get the cosine of the given number.
COT() The COT() function is used to get the cotangent of the given number.
COUNT() The COUNT() function is used to get the total count for the specified column of the table.
DEGREES() DEGREES() function is used to convert the given radian number into a degree.
DIV() The DIV() function is used to find the integer division by dividing the number n by the number m.
EXP() The EXP() function is used to find e raised to the power of number i.e. enumber.
FLOOR() The FLOOR() function is used to find the greatest integer which is equal to or less than the specified number.
GREATEST() The GREATEST() function is used to get the largest number from the list.
LEAST() The LEAST() function is used to get the smallest number from the list.
LN() The LN() function is used to get the natural logarithm for the specified number.
LOG10() The LOG10() function is used to get the base-10 logarithm for the specified number.
LOG() The LOG() function is used to return either the natural logarithm of the given number if it has one parameter or specified base logarithm number if it has two parameters.
LOG2() The LOG2() function is used to get the base-2 logarithm for the specified number.
MAX() The MAX() function is used to get the maximum number of the given column name.
MIN() The MIN() function is used to get the minimum number of the given column name.
MOD() The MOD() function is used to get the remainder for the specified values.
PI() The PI() function is used to get the value of pi upto 6 decimal places.
POWER() The POWER() function is used to get the power for the specified values.
POW() The POW function is used to get the power for the specified values.
RADIANS() The RADIANS() function is used to convert the given degrees to radians.
RAND() The RAND() function is used to generate the random number.
ROUND() The ROUND() function is used to round off the specified number.

Example 1

select pi();

Output:

mysql> SELECT PI();
+----------+
| PI()     |
+----------+
| 3.141593 |
+----------+
1 row in set (0.00 sec)

Example 2

Select pow(3,2); 

Output:

mysql> SELECT POW(3, 2);
+-----------+
| POW(3, 2) |
+-----------+
|         9 |
+-----------+
1 row in set (0.00 sec)

Example 3

select 4 % 3;  

Output:

mysql> SELECT 4 % 3;
+-------+
| 4 % 3 |
+-------+
|     1 |
+-------+
1 row in set (0.00 sec)
Next TopicMySQL Math




Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf