Table 6. Logical Operators
Operator |
Description |
Order of Evaluation |
---|---|---|
NOT |
( a NOT b ) – a must be present but b must NOT be present to be included |
1 |
AND |
( a AND b ) –If both a and b are present, item is included |
2 |
OR |
( a OR b ) – If either a OR b is present item is included |
3 |
Example:
USE world;
SELECT name, population
FROM country
WHERE region = 'caribbean'
AND population > 100000
ORDER BY population ASC;
Results:
This content is provided to you freely by BYU-I Books.
Access it online or download it at https://books.byui.edu/learning_mysql/and_or_not_logical_o.