You can use the escape identifier to search for or

  • No School
  • AA 1
  • 28

This preview shows page 13 - 21 out of 28 pages.

You can use the ESCAPE identifier to search for "%" or "_". You can combine pattern-matching characters. You can use the ESCAPE identifier to search for "%" or "_". SQL> SELECT ename 2 FROM emp 3 WHERE ename LIKE '_A%'; ENAME ---------- MARTIN JAMES WARD
Image of page 13

Subscribe to view the full document.

2-14 Copyright Oracle Corporation, 1998. All rights reserved. Using the IS NULL Operator Using the IS NULL Operator Test for null values with the IS NULL Test for null values with the IS NULL operator. operator. Test for null values with the IS NULL Test for null values with the IS NULL operator. operator. SQL> SELECT ename, mgr 2 FROM emp 3 WHERE mgr IS NULL; ENAME MGR ---------- --------- KING
Image of page 14
2-15 Copyright Oracle Corporation, 1998. All rights reserved. Logical Operators Logical Operators Operator AND OR NOT Meaning Returns TRUE if both component conditions are TRUE Returns TRUE if either component condition is TRUE Returns TRUE if the following condition is FALSE
Image of page 15

Subscribe to view the full document.

2-16 Copyright Oracle Corporation, 1998. All rights reserved. Using the AND Operator Using the AND Operator AND requires both conditions to be TRUE. AND requires both conditions to be TRUE. SQL> SELECT empno, ename, job, sal 2 FROM emp 3 WHERE sal>=1100 4 AND job='CLERK'; EMPNO ENAME JOB SAL --------- ---------- --------- --------- 7876 ADAMS CLERK 1100 7934 MILLER CLERK 1300
Image of page 16
2-17 Copyright Oracle Corporation, 1998. All rights reserved. Using the OR Operator Using the OR Operator OR requires either condition to be TRUE. OR requires either condition to be TRUE. OR requires either condition to be TRUE. OR requires either condition to be TRUE. SQL> SELECT empno, ename, job, sal 2 FROM emp 3 WHERE sal>=1100 4 OR job='CLERK'; EMPNO ENAME JOB SAL --------- ---------- --------- --------- 7839 KING PRESIDENT 5000 7698 BLAKE MANAGER 2850 7782 CLARK MANAGER 2450 7566 JONES MANAGER 2975 7654 MARTIN SALESMAN 1250 ... 7900 JAMES CLERK 950 ... 14 rows selected.
Image of page 17

Subscribe to view the full document.

2-18 Copyright Oracle Corporation, 1998. All rights reserved. Using the NOT Operator Using the NOT Operator SQL> SELECT ename, job 2 FROM emp 3 WHERE job NOT IN ('CLERK','MANAGER','ANALYST'); ENAME JOB ---------- --------- KING PRESIDENT MARTIN SALESMAN ALLEN SALESMAN TURNER SALESMAN WARD SALESMAN
Image of page 18
2-19 Copyright Oracle Corporation, 1998. All rights reserved. Rules of Precedence Rules of Precedence Override rules of precedence by using Override rules of precedence by using parentheses. parentheses. Override rules of precedence by using Override rules of precedence by using parentheses. parentheses. Order Evaluated Operator 1 All comparison operators 2 NOT 3 AND 4 OR
Image of page 19

Subscribe to view the full document.

2-20 Copyright Oracle Corporation, 1998. All rights reserved.
Image of page 20
Image of page 21
  • Fall '19

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes