SQL Arithmetic Operators



In this tutorial we will be learning the simple SQL queries showing usage of SQL Arithmetic Operators:

SQL> select 30 + 20;
+--------+
| 30+ 20 |
+--------+
|     50 |
+--------+
1 row in set (0.00 sec)

In the below query – Multiplication Example

SQL> select 30 * 20;
+---------+
| 30 * 20 |
+---------+
|     600 |
+---------+
1 row in set (0.00 sec)

In the below query – Division of numbers Example

SQL> select 30 / 5;
+--------+
| 30 / 5 |
+--------+
| 6.0000 |
+--------+
1 row in set (0.03 sec)

In the below query – Modulus Operator Example

SQL> select 11 %  5;
+---------+
| 11 %  5 |
+---------+
|       1 |
+---------+
1 row in set (0.00 sec)