SQL Arithmetical operators

In this chapter you will learn:
What is Arithmetical operators?
Types of Arithmetical operators
Examples of Arithmetical operators
What is Arithmetical operators?

Operator that is used for mathematical calculation or arithmetic operation is called arithmetic operator. There are a number of Arithmetic operators that are given in the table.

Types of Arithmetical operators

Arithmatical Operator Use
+ Addition
- Subtraction
* Multiplication
/ Division
% Remainder of a division

Example of Arithmatical operator

SELECT PurchaseOrderID, SubTotal,  
TaxAmt, Total = (SubTotal + TaxAmt)
FROM Purchasing.PurchaseOrderHeader
WHERE (SubTotal + TaxAmt)>15000;

Output

arithmatical operator example

Example Description

In the above example the + operator is used to add the SubTotal and TaxAmt column value and display the added value in a new column (Total).

SUMMARY

In this chapter we have learned arithmetical operator and it's type with examples. In the next chapter you will learn assignment operater and its type.

 

Share your thought