RADIANS Function in SQLThe RADIANS numeric function of Structured Query Language returns the radians value of the specified degree. Syntax of RADIANS FunctionSyntax1: This syntax uses the RADIANS function with the column name of the SQL table: In this first syntax, we have to specify the name of that column on which we want to execute the RADIANS function for converting the degree value into radians. Syntax2: This syntax uses the RADIANS function with the number: Examples of RADIANS FunctionExample 1: This example returns the Radians value of the specified number (degree): Output:
Example 2: This example returns the Radians value of the specified number: Output:
Example 3: This example returns the Radians value of 90 degree: Output:
Example 4: This example returns the Radians value of -45 degree: Output:
Example 5: This example returns the Radians value of the given expression: The following CREATE statement creates the Vehicle_Details table for storing the details of purchasing and selling vehicles: The following multiple INSERT queries insert the records of vehicles with their quantity, and number of selling and purchasing vehicles into the Vehicle_Details table: The following SELECT statement displays the inserted records of the above Vehicle_Details table:
Query 1: The following SELECT query uses the RADIANS function with the Vehicle_ID column of the above Vehicle_Details table: This query shows the Radians value of vehicle id of each vehicle. Output:
Query 2: The following SELECT query uses the RADIANS function with the Purchasing_Vehicles column of the above Vehicle_Details table: This query shows the Radians value of purchasing vehicles. Output:
Query 3: The following SELECT query uses the RADIANS function with the Vehicle_Rating column of the above Vehicle_Details table: This query shows the Radians value of rating of each vehicle from the above table. Output:
Query 4: The following SELECT query uses the RADIANS function with the and Purchasing_Vehicles and Selling_Vehicles column of the above Vehicle_Details table: This query shows the Radians value of selling Vehicles of each vehicle. Output:
Next TopicRAND Function in SQL
|