Operator
|
Purpose
|
Example
|
NOT
|
Returns TRUE if the following condition is FALSE. Returns FALSE if it is TRUE. If it is UNKNOWN, it remains UNKNOWN.
|
SELECT * FROM emp WHERE NOT (job IS NULL);
SELECT * FROM emp WHERE NOT (sal BETWEEN 1000 AND 2000);
|
AND
|
Returns TRUE if both component conditions are TRUE. Returns FALSE if either is FALSE; otherwise, returns UNKNOWN.
|
SELECT * FROM emp WHERE job = 'CLERK' AND deptno = 10;
|
OR
|
Returns TRUE if either component condition is TRUE. Returns FALSE if both are FALSE; otherwise, returns UNKNOWN.
|
SELECT * FROM emp WHERE job = 'CLERK' OR deptno = 10;
|