From the course: Quick Start Guide to SQL

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Operators

Operators

- [Instructor] Let's learn about the different types of operators. There are two types of operators: arithmetic operators and character string operators. Arithmetic operators are used in mathematical expressions, like plus sign, minus, asterisk and slash. Character string operators are used with strings, like concat symbol, which is two pipelines, single quotes and double quotes. Order of precedence for arithmetic operators is multiplication, then division, then addition, and finally, subtraction. As shown in the example, multiplication is performed first and then the addition but if we are using a parenthesis, it overrides the rules of precedence as shown in the second example. So in this scenario, first, the addition is performed because it is in the parenthesis and then the multiplication is done. If an expression has two operators of same precedence, then it is evaluated from left to right as shown in…

Contents