SIN
SIN is an SQL mathematical function that returns the sine of a specified angle.
Example
Output
Explanation
The SIN()
function in MySQL returns the sine of an angle provided in radians. The PI()
function returns the value of PI. Thus, SIN(PI()/4)
calculates the sine of 45 degrees. The output 0.70710678118655
is the result of this calculation.
Example
Output
Explanation
The SIN function in PostgreSQL calculates the sine of a number. In the example above, the sine of 1 was computed.
Example
Output
Explanation
In the example, a variable @Value
is declared and initialized to PI()/4. SIN(@Value)
function is called which calculates the sine of the given value. The result is then selected and displayed as SinValue
, which is 0.707106781186547 in this case.
Example
Output
Explanation
The above SQL command calculates the sine of 45 degrees. The radians
function is used to convert 45 degrees to radians before SIN
is called.
Example
Output
Explanation
The SIN
function in SQLite returns the sine of a number. In the given example, SIN(1)
returns 0.8414709848078965
, which is the sine of 1.