Arithmetic Operators

I am going to start a series of very short articles or tidbits on Transaction SQL Operators. An operator is a symbol specifying an action that is performed on one or more expressions.

I will exploring the Arithmetic Operators today.

The very first practical use of modern day computers was to solve mathematical problems. The ENIAC computer in 1946 was used by the United States Army to create artillery firing tables.

TSQL supports the following five basic operations: addition, subtraction, multiplication, division and modulus.

Most people know the first four mathematical operations by heart. A modulo operation is defined as the as the whole number remainder after division is performed.

The example below performs a simple calculation using each operator.

The output of each calculation is listed below.

Please note that there is a precedence order when it comes to operator evaluation. We will dive into those details in a later talk.

Next time, I will be exploring the Assignment Operator.

Related posts

Leave a Comment