SELECT COS(PI()); // Output is -1
SELECT ROUND(COS(PI()/2),2); // Output is 0.00
SELECT ROUND(COS(PI()/3),2); // Output is 0.5
We used ROUND() to show only two decimal places. SELECT COS( X )
X is in Radian Radians function convert degree value to radian.
SELECT COS(RADIANS(0)); // Output is 1 SELECT ROUND(COS(RADIANS(90)),2); // Output is 0.00 SELECT COS(RADIANS(180)); // Output is -1SQL Math ReferencesTAN() to get tangent sin()