Day – 14 :
Types of Operators in
SQL
Course created by Satish Dhawale | www.skillcourse.in
Here is a list of the types of operators in SQL:
Arithmetic Comparison Logical Bitwise
Operators Operators Operators Operators
Set String Other
Operators Operators Operators
Arithmetic Operators
Operator Description Example Result
+ Addition SELECT 10 + 5; 15
- Subtraction SELECT 10 - 5; 5
* Multiplication SELECT 10 * 5; 50
/ Division SELECT 10 / 5; 2
Modulus
% SELECT 10 % 3; 1
(remainder)
1) Retrieve the first_name, salary, and
calculate a 10% bonus on the salary.
SELECT FIRST_NAME,SALARY,
(SALARY * 0.10) AS BONUS
FROM EMPLOYEE2;
2) Calculate the Annual Salary and
Salary Increment by 5% - show the
monthly new salary as well
SELECT first_name, last_name, salary,
(salary * 12) AS annual_salary,
(salary * 0.05) AS increment_amount,
(salary * 1.05) AS new_salary,
(salary + salary*0.05) as new_salary2
FROM employee2;