The SQL ASIN is one of the Mathematical Function, which is used to calculate the trigonometry Arc sine for the specified expression. SQL Arc sine is also called inverse of a SINE Function. The syntax of the SQL Server ASIN Function is:
SELECT ASIN (Float_Expression) FROM [Source]
TIP: The ASIN function only accepts float values between -1 and 1.
For this ASIN Function demo, we use the below-shown data
SQL ASIN Function Example 1
The ASIN function is used to calculate the Arc SINE for a given angle. The following query will show multiple ways to use the ASIN function.
DECLARE @i Float SET @i = -0.80 SELECT ASIN(@i)AS [Arc Sine] -- Calculating ASIN directly SELECT ASIN(0.27)AS [Arc Sine] -- Calculating ASIN directly SELECT ASIN(0.25 + 0.55 - 0.77)AS [Arc Sine]
We used this SQL Serve function to calculate the Arc sine value for the variable @i. It means ASIN(-0.80) and assigned a new name as ‘Arc Sine’ using ALIAS.
SELECT ASIN(@i)AS [Arc Sine]
ASIN Function Example 2
We are going to calculate the Arcsine value for all the records present in [Service Grade] using the ASIN Mathematical Function.
SELECT [EnglishProductName] ,[Color] ,[StandardCost] ,[SalesAmount] ,[Service Grade] AS Grade ,ASIN([Service Grade]) AS [Arc Sine] FROM [Mathemetical Functions]