Math functions in MySQL

We can use various mathematical functions available in MySQL queries to handle our numeric data in a table. We can update our data with new data or use them in our script as per our requirements. We will discuss some of the important math functions used frequently in queries for MySQL table.
Functions Description
ABSAbsolute value of a number
ACOSArc cos of the input
ASINArc sin of the input
ATANArc tan of the input
ATAN2Arc tan of two inputs
AVGWe can get the average value of a range of data by using avg function.
CEILMath ceil function to get lowest integer value.
CONV()Convert one base to another
COS()COS() function takes input in Radian
COT()COT() function takes input in Radian
COUNTCounting the number of records in a table with conditions
CRC32()CRC32() returns 32 bit unsigned value of a string
DEGREESConvert Radian value to Degree
EXPe raised to the power of X
FLOORMath floor function to get highest integer value.
LNLog of the number (Same as LOG())
LOGLog of the number with different Base value
LOG10Log of the number with fixed Base 10 value
LOG2Log of the number with fixed Base 2 value
MAXMaximum value from a field of mysql table by using max command
MINMinimum value among records by using MIN Query
ModGetting the reminder of a division and using in our Query
PIPI() value with different functions
POWPower of a number & creating a square table
RADIANSConverting Degree to Radians in our Query
ROUNDRounded to decimals
SIGNSign of the argument
SINSin of a radian input
SUMOur query can return sum of numeric data present in a record
TANTan of a radian input
Second highestWE can display first and second highest number present in table by using limit and order by commands
Data formatGetting the formatted output from mysql table by using format query.
sqrtSquare root of number
TRUNCATEConverting to fixed decimal value
STDDEV()Standard Deviation

Find out non-numeric values present in a Column by using CONCAT


* indicates required
Subscribe to plus2net



    iwant learn math using php and mysql

    Post your comments , suggestion , error , requirements etc here .

    SQL Video Tutorials

    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2021 All rights reserved worldwide Privacy Policy Disclaimer