SQL Operators


Check out our collection of SQL Operators below. For more information on any of the operators, just click on the operator name!

Categories

Arithmetic Operators


Operator

Objective

Preview


Add two numeric expressions

Addition 🔗

expression1 + expression2

Subtract one numeric expression from another

expression1 - expression2

Multiply two numeric expressions

expression1 * expression2

Divide one numeric expression by another

Division 🔗

expression1 / expression2

Return the remainder of one numeric expression divided by another

Modulus 🔗

expression1 % expression2

Comparison Operators


Operator

Objective

Preview


Compare two expressions for equality

Equal to 🔗

expression1 = expression2

Compare two expressions for inequality

expression1 <> expression2

Compare if one expression is less than another

Less than 🔗

expression1 < expression2

Compare if one expression is greater than another

expression1 > expression2

Compare if one expression is less than or equal to another

expression1 <= expression2

Compare if one expression is greater than or equal to another

expression1 >= expression2

Check if a value is within a range of values

BETWEEN 🔗

value BETWEEN low AND high

Check if a value matches any value in a list of specified values

IN 🔗

value IN (value1, value2, …)

Match a value against a pattern using wildcard characters

LIKE 🔗

column_name LIKE pattern

Check if a value is NULL

IS NULL 🔗

column_name IS NULL

Check if a value is not NULL

column_name IS NOT NULL

Logical Operators


Operator

Objective

Preview


Combine multiple conditions where all must be true

AND 🔗

condition1 AND condition2

Combine multiple conditions where at least one must be true

OR 🔗

condition1 OR condition2

Negate a condition or check for the absence of a value

NOT 🔗

NOT condition

Set Operators


Operator

Objective

Preview


Combine the results of two or more SELECT statements into a single result set

UNION 🔗

No Preview Available - Too Long

Combine the results of two or more SELECT statements into a single result set, including all rows (including duplicates)

UNION ALL 🔗

No Preview Available - Too Long

Combine the results of two SELECT statements and return only rows that appear in both result sets

INTERSECT 🔗

No Preview Available - Too Long

Combine the results of two SELECT statements and return only the rows that appear in the first result set but not in the second

EXCEPT 🔗

No Preview Available - Too Long

Assignment Operators


Operator

Objective

Preview


Assign a value to a variable or update a column's value in a table

= (Equals) 🔗

=column1 = value1