Rules of Precedence :- Arithmetic operators
- Concatenation operator
- Comparison conditions
- IS [NOT] NULL, LIKE, [NOT] IN
- [NOT] BETWEEN
- Not equal to
- NOT logical condition
- AND logical condition
- OR logical condition
Logical Conditions :
Operator Meaning - OR Returns TRUE if either component condition is true
- AND Returns TRUE if both component conditions are true
- NOT Returns TRUE if the following condition is false
Using the AND Operator :- AND requires both conditions to be true
- SELECT empno, ename, sal FROM emp WHERE sal >=1000 AND job LIKE '%MAN%' ;
Using the OR Operator :- OR requires any condition to be true
- SELECT empno, ename, sal FROM emp WHERE sal >=1000 OR job LIKE '%MAN%' ;
Using the NOT Operator :- SELECT empno, ename, job FROM emp WHERE sal >=1000 AND job NOT IN (‘CLERK’,’SALESMAN’) ;