Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions content/sql/concepts/math-functions/terms/asin/asin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
Title: 'ASIN()'
Description: 'Returns the arcsine of a number.'
Subjects:
- 'Data Science'
- 'Computer Science'
Tags:
- 'SQLite'
- 'PostgreSQL'
- 'MySQL'
- 'Functions'
CatalogContent:
- 'learn-sql'
- 'paths/analyze-data-with-sql'
---

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

## Syntax

```pseudo
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`:

```sql
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.