DBMS | Arithmetic Operators | Exp - 5
Arithmetic Operation in SQL
Arithmetic Operators are:
+ [Addition] - [Subtraction] / [Division] * [Multiplication] % [Modulus]
Addition (+) :
It is used to perform addition operation on the data items, items include either single column or multiple columns.
Implementation:
SELECT employee_id, employee_name, salary, salary + 100 AS "salary + 100" FROM addition;
Subtraction (-) :
It is use to perform subtraction operation on the data items, items include either single column or multiple columns.
Implementation:
SELECT employee_id, employee_name, salary, salary - 100 AS "salary - 100" FROM subtraction;
Multiplication (*) :
It is use to perform multiplication of data items.
Implementation:
SELECT employee_id, employee_name, salary, salary * 100 AS "salary * 100" FROM addition;
For more info visit GeeksforGeeks
No comments: