MySQL ASIN Function

MySQL ASIN function is one of the Numeric Functions, which is useful to calculate the trigonometric Arcsine of the specified expression. The basic syntax of the MySQL ASIN Function is as shown below:

SELECT ASIN (Numeric_Expression)
FROM Source
  • If the Numeric_Expression is between -1 and +1, then it returns the arc sine of the value.
  • If the Numeric_Expression is not between -1 and +1, then it returns NULL.
  • And, If you pass the NULL value, then the function returns NULL.

To demonstrate this Numeric function, we are going to use the below shown data.

Table 1

MySQL ASIN Function Example

It returns the trigonometric Arcsine of any numeric value. The following query shows multiple ways to use the MySQL ASIN function.

-- Arc Sine of Negative Value
SELECT ASIN(-0.53) AS `Arc Sine Value`;

-- Arc Sine of Positive Value
SELECT ASIN(0.92) AS `Arc Sine Value`;

-- Arc Sine of Numeric Expression
SELECT ASIN(1.25 + 2.65 - 3.25) AS `Arc Sine Value`;

-- Arc Sine of string value
SELECT ASIN('0.53') AS `Arc Sine Value`;

-- Arc Sine of String
SELECT ASIN('MySQL') AS `Arc Sine Value`;

In the below statement, we used this method to find the Arc Sine of different values.

MySQL ASIN function Example 1

This Numeric method also allows you to find the arcsine of the data in a table. In this MySQL example, we are going to find the arcsine for all the records present in the Service Grade column.

SELECT Product, Color,
		StandardCost, Sales, TaxAmt, 
        ASIN(ServiceGrade) AS `Arc Sine Value`
FROM `numeric functions`;
MySQL ASIN Function Example 2