

The next example gets the radian value of 135 degrees: SELECT RADIANS(135) RAND

The RADIANS SQL function converts degree values into radians. The next example shows the result of 11 x 11 x 11 (11 raised to the power of 3), which is 1331: SELECT POWER(11, 3) RADIANS The POWER SQL function returns the value of one number raised to the power of another number. The next example will show each student’s lowest marks: SELECT It returns the minimum value in a group of values. The MIN SQL function is also an aggregate function. The next example will show each student’s highest marks: SELECT It returns the maximum value in a group of values. The MAX SQL function is also an aggregate function. The next example shows 56, because 56 is the next biggest integer value that is smaller than 56.21: SELECT FLOOR(56.21) MAX The FLOOR SQL function returns the largest value(integer) that is smaller than or equal to a given number. The next example divides PI by 2 to return the 90 degrees: SELECT DEGREES(PI() / 2) FLOOR The DEGREES SQL function converts radian values into degrees.
#Numeric sql how to
The following shows how to obtain the cotangent of a certain number: SELECT COT(0.17) The COT SQL function returns the cotangent of a number. The next example shows how to obtain the cosine of a certain number: SELECT COS(0.17) The COS SQL function returns the cosine of a number. The next example will count the number of students that are doing a “Programming” class: SELECT It returns the number of records returned by a query. The COUNT SQL function is also an aggregate function. The next example shows 57, because 57 is the next smallest integer value that is higher than 56.21: SELECT CEILING(56.21) COUNT The CEILING SQL function returns the smallest value(integer) that is greater than or equal to a given number. The AVG function is an aggregate function (a function that performs a calculation on one or more values, but returns a single value) CEILING The next example selects all the students whose average marks are greater than 75: SELECT The AVG SQL function returns the average of an expression. The next example shows how to obtain the arc tangent of a certain number: SELECT TAN(17) The ATAN SQL function returns the inverse tangent of a number. The next example shows how to obtain the arc sine of a certain number: SELECT SIN(0.17) The ASIN SQL function returns the inverse sine of a number. The next example shows how to obtain the arc cosine of a certain number: SELECT ACOS(0.17) The ACOS SQL function returns the inverse cosine of a number. Here is a short SQL example demonstrating the use of the ABS SQL function SELECTīoth give the same result of 179.3, as the negative sign gets removed. For example: -5 is 5 away from 0, and 5 is also 5 away from 0. An Absolute value means how far a certain number is from zero.

The SQL ABS function returns the absolute value of a number. The following is a list of the most popular SQL Numeric functions: The SQL language has a plethora of numeric and mathematic functions, and in this article, you’ll see how to make use of them.
