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

Problem Statement

As per government norms a Company who have employee count more than or equal to 25, they must implement Provident Fund (PF). The PF should be 12% of employee’s basic salary and the same amount will be credit by the Company. Thus the PF record should be maintain in employee table.

No comments:

Powered by Blogger.