w3resource

MySQL DIVISION operator

DIVISION operator

MySQL division operator is used for integer division.

This function is useful in -

  • Division is used to scale quantities and establish proportions.
  • In statistics, division is a fundamental operation for calculating averages and means.
  • Division is extensively used in financial calculations, including interest rates, profit margins, investment returns, and various other financial metrics.
  • In graphic design and digital imaging, division is employed to adjust the scale of images, change resolutions, and control visual elements.
  • In SQL queries, division can be used to perform complex calculations on data stored in a database.
  • Division is pervasive in physics and engineering for solving equations, determining physical properties, and performing simulations.

Syntax:

num / num

Arguments:

Name Description
num Dividend.
/ Division operator.
num Divisor.

MySQL Version: 8.0

Example of MySQL DIVISION() function

Code:

SELECT 12 / 3;

Explanation:

The above MySQL statement divides 12 by 3.

Output:

mysql> SELECT 12 / 3;
+--------+
| 12 / 3 |
+--------+
| 4.0000 | 
+--------+
1 row in set (0.00 sec)

All Mathematical Functions

Previous: DIV
Next: EXP()



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://www.w3resource.com/mysql/mathematical-functions/mysql-division-operator.php