Tutorials Hut

• # SQL Operators | Arithmetic, Comparison & Logical Operator

SQL operators are used to perform operations like comparisons and arithmetic operations.

there are three types of operators in SQL ## Arithmetic operators

SQL Arithmetic operator are the operators which are used for mathematical calculation like addition, subtraction etc.

Suppose x= 10 and y =30

 Operator Description Example + Addition x+y= 40 – Subtraction x-y= -20 * Multiplication x*y=300 / Division y/x= 3 % Modulo y%x=0

## Logical operators

Logical operators are the operators which are used for logical operations

 Operator Description ALL compare a value to all values in another value set AND For a row to be selected all the specified conditions must be true BETWEEN search for values which are within a set of values IN Allows multiple values in a WHERE clause. LIKE used to compare a value to similar values using wildcard operators. NOT For a row to be selected all the specified conditions must be false OR For a row to be selected at least one of the conditions must be true EXISTS Condition is met if subquery returns at least one row

## Relational Operators

Relational Operators are used to compare the values of two columns in SQL statements.

 Operator Description = Equal <= Less Than or Equal >= Greater Than or Equal <> or != Not Equal < Less Than > Greater Than

Recommended Articles: