MySQL DEGREES Function

MySQL DEGREES function is one of the Numeric Functions, which is useful to convert the radiant values into degrees. The syntax of the DEGREES is as shown below:

SELECT DEGREES (Numeric_Expression)
FROM Source

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

Source Table 1

MySQL DEGREES Function Example

This method converts the radiant values to degrees, and the following query shows multiple ways to use this.

-- Finding for Negative Value
SELECT DEGREES(-10.75) AS `Value in Degrees`;

-- Finding for Positive Value
SELECT DEGREES(2.67) AS `Value in Degrees`;

-- Example along with PI()
SELECT DEGREES(PI()) AS `Value in Degrees`;
SELECT DEGREES(PI()/2) AS `Value in Degrees`;
SELECT DEGREES(PI()/3) AS `Value in Degrees`;

-- string value
SELECT DEGREES('6.74') AS `Value in Degrees`;

-- on String text
SELECT DEGREES('MySQL') AS `Value in Degrees`;

From the below screenshot, you can see that we used the DEGREES function on different values.

Example 1

and

Example 2

In MySQL, this Numeric method also allows you to find the values for the column data. In this example, we are going to find the equivalent values for all the records present in the Service Grade column.

SELECT Product, Color,
		StandardCost, Sales, TaxAmt,
        ServiceGrade,
        DEGREES(ServiceGrade) AS `Grade Value inDegrees`
FROM `numeric functions`;
MySQL Degrees Function 3