Database Reference
In-Depth Information
7.2.2
Logical Operators
Logical operators are NOT, AND, and OR, in that order of precedence.
NOT implies that an expression must be false for a TRUE result; AND
implies that two expressions must be true for a TRUE result; and OR
implies that either of two expressions must be true for a TRUE result.
There are more examples in Chapter 5.
<expression> AND <expression> such that both expressions yield
TRUE. This example finds artists whose names contain the vowel “a”
and who live in the USA. Both conditions must be true for a row to
be returned. The result is shown in Figure 7.2.
SELECT NAME, COUNTRY FROM ARTIST
WHERE COUNTRY = 'USA' AND NAME LIKE '%a%';
Figure 7.2
The AND Logical
Operator.
Search WWH ::




Custom Search