A complex predicate combines any number of predicates with the Boolean operators AND, OR, and NOT. Boolean operators are also called logical operators. (B)0[m[1mcomplex-predicate = [m [1m [m [1mqwqwqqqqqqqqwqwqq> complex-predicate qwqqqwqqqqqqqqqqq> [m [1m x mq> [1;4mNOT[m[1m qj mqq> predicate qqqqqqqqqj tq> [1;4mAND[m[1m qwqk [m [1m x mq> [1;4mOR[m[1m qqj x [m [1m mqqqqqqqqqqqqqqqqqqqqqqqqq<qqqqqqqqqqqqqqqqqqqqqqqqqj [m [1m [m When nesting predicates, you must enclose them in parentheses. SQL evaluates parts of a complex predicate in this order: 1. Predicates enclosed in parentheses If there are nested predicates in parentheses, the innermost predicate is evaluated first. 2. Predicates preceded by NOT 3. Predicates combined with AND 4. Predicates combined with OR The following tables summarize how SQL evaluates predicates combined with Boolean operators. Such tables are often called truth tables. Table 4 Boolean Operator: AND A B A AND B True False False True True True False False False False True False True Unknown Unknown False Unknown False Unknown True Unknown Unknown False False Unknown Unknown Unknown Table 5 Boolean Operator: OR A B A OR B True False True True True True False False False False True True True Unknown True False Unknown Unknown Unknown True True Unknown False Unknown Unknown Unknown Unknown Table 6 Boolean Operator: NOT A NOT A True False False True Unknown Unknown NOTE The fact that NOT A is evaluated as unknown when A is unknown can be confusing in queries that refer to tables with null values. It means that a NOT predicate is not necessarily evaluated as true for all rows of a column for which the same predicate without NOT is evaluated as false. In other words, the result of a query that contains NOT A is not necessarily the complement of the result of the same query that contains only A.