Tutorial Gateway

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

MySQL TAN Function

by suresh

MySQL TAN function is one of the Numeric Functions, which is useful to calculate the trigonometric Tangent of the specified expression. The mathematical formula for this MySQL tangent function is TAN(x) = Length of the Opposite Side / Length of the Adjacent Side.

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

SELECT TAN (Numeric_Expression)
FROM Source

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

MySQL TAN Function Example 1

MySQL TAN Function Example 1

The MySQL TAN returns the trigonometric tangent values for any numeric data. The following query shows multiple ways to use the TAN function.

-- MySQL TAN Function Example

-- Tangent of Negative Value
SELECT TAN(-5.64) AS `Tangent Value`;

-- Tangent of Positive Value
SELECT TAN(PI()) AS `Tangent Value`;

-- Tangent of Numeric Expression
SELECT TAN(6.55 + 5.95 - 7.15) AS `Tangent Value`;

-- Tangent of string value
SELECT TAN('2.76') AS `Tangent Value`;

-- Tangent of String
SELECT TAN('MySQL') AS `Tangent Value`;

As you can see, we used this TAN function to find the Tangent of different values.

MySQL TAN Function Example 2

MySQL TAN Example 2

The TAN Numeric Function also allows you to find the tangent of the table data. In this MySQL example, we are going to find the tangent value for all the records present in the Service Grade column.

-- MySQL Tangent Example
USE mysqltutorial;
SELECT Product, Color,
		StandardCost, Sales, TaxAmt, 
        ServiceGrade,
        TAN(ServiceGrade) AS `Grade Tangent Value`
FROM `numeric functions`;

OUTPUT

MySQL TAN 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