devxlogo

Use MySQL for Calculations

Use MySQL for Calculations

At times, when you want to compute the result of a mathematical formula, you can use MySQL to do the task. It is a great tool for this. Here are a few examples:

Query:

SELECT PI();

Output:

+------------+| PI()       |+------------+| 3.141593   |+------------+

Query:

SELECT PI() * 7;

Output:

+------------+| PI() * 7   |+------------+| 21.991149  |+------------+

Query:

SELECT 399*12/4, 6*12;

Output:

+------------+------------+| 399*12/4   | 6*12       |+------------+------------+| 1197.0000  | 72         |+------------+------------+
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist