Arithmetic_Operators_SQL
Arithmetic_Operators_SQL
1. Introduction
Arithmetic operators in SQL are used to perform mathematical operations on numerical data types.
-----------|-------------------------|-----------------
+ | Addition | 10 + 5 = 15
- | Subtraction | 10 - 5 = 5
* | Multiplication | 10 * 5 = 50
/ | Division | 10 / 5 = 2
% | Modulus (Remainder) | 10 % 3 = 1
3. Syntax
FROM table_name;
---------|----------|---------
1 | Alice | 30000
2 | Bob | 45000
3 | Carol | 50000
1. Addition (+)
2. Subtraction (-)
FROM employees;
3. Multiplication (*)
FROM employees;
4. Division (/)
FROM employees;
5. Modulus (%)
FROM employees;
6. Conclusion
- They can be used in SELECT, WHERE, HAVING, and other SQL clauses.