# Source: https://docs.oxla.com/sql-reference/sql-functions/math-functions/sin.md

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.oxla.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SIN

## Overview

`SIN()` is a numeric function that returns the trigonometric sine value of a specified angle in radians.

## Syntax

The syntax of the `SIN()` function is as follows.

```sql  theme={null}
SIN (x)
```

The `SIN()` function requires one argument:

`x`:  A positive or a negative angle (or an expression that evaluates to an angle).

## Examples

### Case #1: Sine a Positive Value

The example below will use the `SIN()` function with a positive angle as the argument.

```sql  theme={null}
SELECT SIN(5);
```

It will return the sine value of 5.

```sql  theme={null}
+-----------------------+
| f                     |
+-----------------------+
| -0.9589242746631385   |
+-----------------------+
```

### Case #2: Sine a Negative Value

The following example shows the `SIN(`) function with a negative angle as the argument.

```sql  theme={null}
SELECT SIN(-3);
```

The output will be as follows.

```sql  theme={null}
+----------------------+
| f                    |
+----------------------+
| -0.1411200080598672  |
+----------------------+
```

### Case #3: Sine a Fraction Value

The following example shows the `SIN()` function with a fractional value as the argument.

```sql  theme={null}
SELECT SIN(5.8732);
```

The output will be as follows.

```sql  theme={null}
+----------------------+
| f                    |
+----------------------+
| -0.3985959081271079  |
+----------------------+
```

### Case #4: Sine With an Expression

The `SIN()` function can also include an expression, as shown in the example below:

```sql  theme={null}
SELECT sin(8.5 * 2.3);
```

You will get the following output:

```sql  theme={null}
+-----------------------+
| f                     |
+-----------------------+
| 0.6445566903363104    |
+-----------------------+
```

### Case #5: Using the `SIN()` Function With a Table

In the following example, we will combine `SIN()` function with `CREATE TABLE` statement to obtain the sine values of a specific column.

1. Create a new table named **sineTable** containing the **initialValue** column. Input some values with the negative and positive angles into the column.

```sql  theme={null}
CREATE TABLE sineTable(initialValue int);
INSERT INTO sineTable(initialValue)
VALUES (-5),(18), (0),(-27);
```

2. Run the query below to get the output of a sine value:

```sql  theme={null}
SELECT * ,SIN(initialValue) AS sinValue FROM sineTable;
```

3. The final result will have the **initialValue** column with the source value and the **sinValue** column with their calculated sine values.  

```sql  theme={null}
+---------------+-------------------------------+
| initialvalue  | sinValue                      |
+---------------+-------------------------------+
| -75           | 0.38778163540943045           |
| 180           | -0.8011526357338304           |
| 0             | 0                             | 
| -270          | 0.1760459464712114            |
+---------------+-------------------------------+
```