SQL - Arithmetic Operators


Advertisements

Here are a few simple examples showing the usage of SQL Arithmetic Operators −

Example 1

SQL> select 10+ 20;

Output

+--------+
| 10+ 20 |
+--------+
|     30 |
+--------+
1 row in set (0.00 sec)

Example 2

SQL> select 10 * 20;

Output

+---------+
| 10 * 20 |
+---------+
|     200 |
+---------+
1 row in set (0.00 sec)

Example 3

SQL> select 10 / 5;

Output

+--------+
| 10 / 5 |
+--------+
| 2.0000 |
+--------+
1 row in set (0.03 sec)

Example 4

SQL> select 12 %  5;

Output

+---------+
| 12 %  5 |
+---------+
|       2 |
+---------+
1 row in set (0.00 sec)
sql-operators.htm

Useful Video Courses


Video

Oracle SQL Online Training

42 Lectures 5 hours

Anadi Sharma

Video

Oracle PL/SQL Online Training

14 Lectures 2 hours

Anadi Sharma

Video

T-SQL Online Training

44 Lectures 4.5 hours

Anadi Sharma

Video

SQL Masterclass: SQL for Data Analytics

94 Lectures 7 hours

Abhishek And Pukhraj

Video

Learn Database Design with MySQL

31 Lectures 6 hours

Eduonix Learning Solutions

Advertisements