SQL ASIN()

arisdelaCruz1413618857's avatar
Published Jun 28, 2023
Contribute to Docs

The ASIN() function in SQL is a mathematical function that returns the inverse sine or arcsine of a number.

  • Learn to analyze data with SQL and prepare for technical interviews.
    • Includes 9 Courses
    • With Certificate
    • Beginner Friendly.
      17 hours
  • In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.
    • Beginner Friendly.
      5 hours

Syntax

ASIN(number)

The specified number must be between -1 and 1, otherwise this function returns NULL.

Example

In this example, the following data is given in the numbers table:

id input_number
1 0.6
2 1
3 -0.9

The ASIN() function is used to calculate the arcsine as output_number:

SELECT id, input_number, ASIN(input_number) AS output_number
FROM numbers;

The output will be:

id input_number output_number
1 0.6 0.64350110879328437
2 1 1.5707963267948966
3 -0.9 -1.1197695149986342

Note: For the use of this method with SQL databases like MySQL, SQLite, PostgreSQL, or SQL Server, refer to their respective documentation for more details on the ASIN() function implementation and compatibility.

All contributors

Contribute to Docs

Learn SQL on Codecademy

  • Learn to analyze data with SQL and prepare for technical interviews.
    • Includes 9 Courses
    • With Certificate
    • Beginner Friendly.
      17 hours
  • In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.
    • Beginner Friendly.
      5 hours