Database Reference
In-Depth Information
Figure 6.22
Combination of NOT and OR logical operators.
Figure 6.23
IS NULL operator.
advisors who are not advising the students with the student id 11 or with the student id 12, use
the query in Figure 6.22.
By using IS NULL in the WHERE clause, you can ind null values in a given column. he
example in Figure 6.23 inds the null values in the column Grade and selects the corresponding
student ids and class ids.
Be aware that NULL is not equal to 0 or empty space. NULL means unknown.
6.2.3 Comparison Operators
Comparison operators are often used to compare two sets of values. Table 6.3 shows commonly
used comparison operators.
he operators <> and ! = are equivalent. Both are not-equal-to operators. To demonstrate the
use of a comparison operator, consider a query that selects the ids of faculty members who advise
students with student ids greater than or equal to 12. he selection result is shown in Figure 6.24.
When comparing two strings, the comparison is based on the order of the American Standard
Code for Information Interchange (ASCII) character set, which contains 256 characters. In an
ascending order, the numerical characters are in order of 0-9 and the English letters are arranged
as A-Z, a-z. When comparing date values with the format dd/mm/yy or dd/mm/yyyy, the com-
parison starts from the year value, not the date value. he comparison of money values is the same
as that of numbers. he example in Figure 6.25 selects the data that are stored in the LastName
column and are greater than or equal to the last name Diaz.
Search WWH ::




Custom Search