3. ABS() Function
“The ABS() function returns the absolute
(positive) value of a number”
Syntax :
Select ABS(number);
Example
Select ABS(-9);
Output: 9
4. CEIL( ) / CEILING( ) Function
“The CEIL() function returns the smallest integer
value that is bigger than or equal to a number.”
Syntax
SELECT CEIL(number);
Example
SELECT CEIL(25.75);
Output : 26
6. FLOOR( ) Function
“The FLOOR() function returns the largest integer
value that is smaller than or equal to a number.
Syntax
SELECT FLOOR(number);
Example
SELECT FLOOR(25.75);
Output : 25
8. MOD( ) Function
“The MOD() function returns the remainder of a number
divided by another number.”
Syntax
SELECT MOD( M , N );
Example
SELECT MOD(18, 4);
Output : 2
9. POW( )/ POWER() Function
“The POW() function returns the value of a number raised to
the power of another number.”
Syntax:
SELECT POW(x, y);
Example
SELECT POW(4, 2);
Output :
x y
4 2
4 * 4 = 16
10. ROUND() Function
The ROUND() function rounds a number to a specified
number of decimal places
Syntax:
SELECT ROUND(number, decimals);
Example
SELECT ROUND(135.375, 2);
12. TRUNCATE( ) Function
The TRUNCATE() function truncates a number to the
specified number of decimal places.
Syntax:
SELECT TRUNCATE(number, decimals);
Example
SELECT TRUNCATE(135.375, 2);
14. SQRT() Function
The SQRT() function returns the square root of a number.
Syntax:
SELECT SQRT(Number);
Example
SELECT SQRT(9);
Output : 3
15. SIGN() Function
The SIGN() function returns the sign of a number.
This function will return one of the following:
If number > 0, it returns 1
If number = 0, it returns 0
If number < 0, it returns -1
Syntax Example
SELECT SIGN(Number); SELECT SIGN(255.5);
Output : 1
16. RAND() Function
The RAND() function returns a random number between 0
(inclusive) and 1 (exclusive)
Syntax:
SELECT RAND(Number);
Example
SELECT RAND(5);
Output : 0.4
17. RADIANS() Function
The RADIANS() function converts a degree value
into radians.
Syntax:
SELECT RADIANS(Number);
Example
SELECT RADIANS(180);
Output : 3.14
18. DEGREES( ) Function
“The DEGREES() function converts a value in radians
to degrees.
Syntax
SELECT DEGREES(radians);
Example
SELECT DEGREES(1.5);
Output : 85.95
19. GREATEST() Function
The GREATEST() function returns the greatest value of the
list of arguments
Syntax:
SELECT GREATEST (arg1, arg2, arg3, ...);
Example
SELECT GREATEST(3, 12, 34, 8, 25);
Output : 34
20. LEAST( ) Function
The LEAST() function returns the smallest value of the list
of arguments.
Syntax
SELECT LEAST(arg1, arg2, arg3, ...);
Example
SELECT LEAST(3, 12, 34, 8, 25);
Output : 3