Skip to content

Commit 7c530fe

Browse files
arisdelacruzSSwiniarskicaupolicandiaz
authored
ASIN() in sql (#2582)
* Create asin.md with contents * Update content/sql/concepts/math-functions/terms/asin/asin.md Co-authored-by: SSwiniarski <86081858+SSwiniarski@users.noreply.github.com> * Update content/sql/concepts/math-functions/terms/asin/asin.md Co-authored-by: SSwiniarski <86081858+SSwiniarski@users.noreply.github.com> * Update content/sql/concepts/math-functions/terms/asin/asin.md Co-authored-by: SSwiniarski <86081858+SSwiniarski@users.noreply.github.com> * Update content/sql/concepts/math-functions/terms/asin/asin.md Co-authored-by: SSwiniarski <86081858+SSwiniarski@users.noreply.github.com> * Update content/sql/concepts/math-functions/terms/asin/asin.md Co-authored-by: SSwiniarski <86081858+SSwiniarski@users.noreply.github.com> * Update asin.md * review edits --------- Co-authored-by: SSwiniarski <86081858+SSwiniarski@users.noreply.github.com> Co-authored-by: Caupolican Diaz <caupolicandiaz@gmail.com>
1 parent ecd416f commit 7c530fe

File tree

1 file changed

+52
-0
lines changed
  • content/sql/concepts/math-functions/terms/asin

1 file changed

+52
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
Title: 'ASIN()'
3+
Description: 'Returns the arcsine of a number.'
4+
Subjects:
5+
- 'Data Science'
6+
- 'Computer Science'
7+
Tags:
8+
- 'SQLite'
9+
- 'PostgreSQL'
10+
- 'MySQL'
11+
- 'Functions'
12+
CatalogContent:
13+
- 'learn-sql'
14+
- 'paths/analyze-data-with-sql'
15+
---
16+
17+
The **`ASIN()`** function in SQL is a mathematical function that returns the inverse sine or arcsine of a number.
18+
19+
## Syntax
20+
21+
```pseudo
22+
ASIN(number)
23+
```
24+
25+
The specified `number` must be between -1 and 1, otherwise this function returns `NULL`.
26+
27+
## Example
28+
29+
In this example, the following data is given in the `numbers` table:
30+
31+
| id | input_number |
32+
| --- | ------------ |
33+
| 1 | 0.6 |
34+
| 2 | 1 |
35+
| 3 | -0.9 |
36+
37+
The `ASIN()` function is used to calculate the arcsine as `output_number`:
38+
39+
```sql
40+
SELECT id, input_number, ASIN(input_number) AS output_number
41+
FROM numbers;
42+
```
43+
44+
The output will be:
45+
46+
| id | input_number | output_number |
47+
| --- | ------------ | ------------------- |
48+
| 1 | 0.6 | 0.64350110879328437 |
49+
| 2 | 1 | 1.5707963267948966 |
50+
| 3 | -0.9 | -1.1197695149986342 |
51+
52+
> **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.

0 commit comments

Comments
 (0)