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.

More Articles

 

Share your thought



PLEASE DISABLE ADBLOCKER AND SUPPORT US!

Please support us by enabling ads on this page. Refresh

YOU DON'T LIKE ADS, WE ALSO DON'T LIKE ADS!
 
But we have to show ads on our site to keep it free and updated. We have to pay huge server costs, domain costs, CDN Costs, Developer Costs, Electricity and Internet Bill. Your little contribution will encourage us to regularly update this site.