Tutorial Gateway

  • C
  • C#
  • Java
  • Python
  • SQL
  • MySQL
  • Js
  • BI Tools
    • Informatica
    • Talend
    • Tableau
    • Power BI
    • SSIS
    • SSRS
    • SSAS
    • MDX
    • R Tutorial
    • QlikView
  • More
    • C Programs
    • C++ Programs
    • Python Programs
    • Java Programs
    • SQL FAQ’s

MySQL SIN Function

by suresh

MySQL SIN function is one of the Numeric Functions, which is useful to calculate the trigonometric sine value of the specified expression. The mathematical formula behind this Sine function is SIN(x) = Length of the Opposite Side / Length of the Hypotenuse.

The basic syntax of the SIN in MySQL is as shown below:

SELECT SIN (Numeric_Expression)
FROM Source

To demonstrate this MySQL SIN Numeric function, we are going to use the below shown data

MySQL SIN Function 1

MySQL SIN Function Example 1

The MySQL Sine function returns the trigonometric sine value for any numeric value. The following query shows multiple ways to use the SIN function.

-- MySQL SIN Function Example

-- Sine of Negative Value
SELECT SIN(-15.35) AS `Sine Value`;

-- Sine of Positive Value
SELECT SIN(5.25) AS `Sine Value`;

-- Sine of Numeric Expression
SELECT SIN(2.25 + 2.75 - 5.00) AS `Sine Value`;

-- Sine of string value
SELECT SIN('9.73') AS `Sine Value`;

-- Sine of String
SELECT SIN('MySQL') AS `Sine Value`;

As you can from the screenshot below, we used the SIN function to find the Sine values for different values. And, we assigned a new name to the MySQL result as ‘ Sine Value’ using ALIAS Column.

MySQL SIN Function Example 2

MySQL SIN Example 2

The MySQL SIN Numeric Function also allows you to find the sine values for the data in a table. In this example, we are going to find the sine for all the records present in the Tax Amount column and Service Grade column.

-- MySQL Sine Function Example
USE mysqltutorial;
SELECT Product, Color,
		StandardCost, Sales, TaxAmt,
        SIN(TaxAmt) AS `Tax Sine Value`,
        ServiceGrade,
        SIN(ServiceGrade) AS `Grade Sine Value`
FROM `numeric functions`;

OUTPUT

MySQL SIN Function Example 3

Placed Under: MySQL

  • How to Download MySQL
  • Install MySQL on Windows
  • MySQL Create Database
  • MySQL Delete Database
  • MySQL Create Table
  • MySQL Drop Table
  • MySQL SELECT Statement
  • MySQL ALIAS Column
  • MySQL Distinct
  • MySQL Insert Statement
  • MySQL Delete
  • MySQL Truncate Table
  • MySQL WHERE Clause
  • MySQL Order By
  • MySQL Group By
  • MySQL Having Clause
  • MySQL LIMIT
  • MySQL Arithmetic Operators
  • MySQL COALESCE Function
  • MySQL AND Operator
  • MySQL NOT Operator
  • MySQL OR Operator
  • MySQL XOR Operator
  • MySQL BETWEEN Operator
  • MySQL Not Between Operator
  • MySQL GREATEST Function
  • MYSQL LEAST Function
  • MySQL LIKE Operator
  • MySQL NOT LIKE Operator
  • MySQL IFNULL Operator
  • MySQL NULLIF Operator
  • MySQL INTERVAL Operator
  • MySQL IS Operator
  • MySQL IN Operator
  • MySQL NOT IN Operator
  • MySQL IS NOT NULL
  • MySQL IS NULL
  • MySQL Inner Join
  • MySQL Cross Join
  • MySQL Right Join
  • MySQL Left Join
  • MySQL Aggregate Functions
  • MySQL Date Functions
  • MySQL Date Function
  • MySQL String Functions
  • MySQL Numeric Functions
  • C Tutorial
  • C# Tutorial
  • Java Tutorial
  • JavaScript Tutorial
  • Python Tutorial
  • MySQL Tutorial
  • SQL Server Tutorial
  • R Tutorial
  • Power BI Tutorial
  • Tableau Tutorial
  • SSIS Tutorial
  • SSRS Tutorial
  • Informatica Tutorial
  • Talend Tutorial
  • C Programs
  • C++ Programs
  • Java Programs
  • Python Programs
  • MDX Tutorial
  • SSAS Tutorial
  • QlikView Tutorial

Copyright © 2021 | Tutorial Gateway· All Rights Reserved by Suresh

Home | About Us | Contact Us | Privacy Policy