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 ASIN in MySQL is as shown below:

SELECT ASIN (Numeric_Expression)
FROM Source
  • If the Numeric_Expression is between -1 and +1, then ASIN Function 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 NULL value, then the function returns NULL.

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

MySQL ASIN Function 1

MySQL ASIN Function Example 1

The ASIN Function returns the trigonometric Arcsine of any numeric value. The following MySQL query shows multiple ways to use the 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 the ASIN function to find the Arc Sine of different values.

MySQL ASIN Example 1

MySQL ASIN Example 2

The ASIN Numeric Function 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 Example 2