Purpose of the Oracle SIN Function
The purpose of the SIN function is to calculate the sine of a number.
The sine is the ratio of the length of the side of the triangle opposite the angle to the length of the triangle’s hypotenuse. More information can be found here.
It’s one of three similar functions, with the other two being COS and TAN.
The syntax of the SIN function is:
The parameters of the SIN function are:
- number (mandatory): The number used to calculate the sine.
The number parameter can be any numeric data type. If the data type is a BINARY_FLOAT, the return type is a BINARY_DOUBLE. Otherwise, the return type is the same as the type of the parameter.
Examples of the SIN Function
Here are some examples of the SIN function. Most of the examples are the the same except for a different input value, as the function is a simple function.
SELECT SIN(20) AS sin_value FROM dual;
SELECT SIN(1) AS sin_value FROM dual;
SELECT SIN(6) AS sin_value FROM dual;
Some functions which are similar to the SIN function are:
- COS: Returns the cosine of a number.
- TAN: Returns the tangent of a number.
- COSH: Returns the hyperbolic cosine of a number.
- SINH: Returns the hyperbolic sine of a number.
- TANH: Returns the hyperbolic tangent of a number.
If you want to know more about SQL functions, you can find a full list of Oracle SQL functions here.
Lastly, if you enjoy the information and career advice I’ve been providing, sign up to my newsletter below to stay up-to-date on my articles. You’ll also receive a fantastic bonus. Thanks!