OPERATORS:
Operators are used to limit the number of results from the query. Also they are used for mathematical and logical operations. Here are a few types of operators.
Standard Operators:
= equal to
<>, != not equal to
< less than
<= less than or equal to
> greater than
>= greater than or equal to
between used to show between two numbers
Logical Operators:
AND used when both conditions are included
OR used when either of the condition is true
NOT opposite of the logical value
Null Operator:
IS NULL this checks if the field has a null
IS NOT NULL this checks to see if it is not null
List Operator:
IN included in the list e.g.
IN ('Phoenix', 'Dallas', 'San Diego') checks to make sure the city is one of the three listed
NOT IN not included in the list
BETWEEN used to limit the values in a range e.g.
BETWEEN 55 AND 65 checks to see that the age of the employee is in the correct range
Character Operator:
LIKE equal to some character (use quotes)
NOT LIKE not equal to the character
Note: With the LIKE operator, you can also use % around the character to return similar patterns e.g.
If the list of Names include John, Mike, Tim and Josh
LIKE 'Jo%' with return John and Josh