Skip to main content
Engineering LibreTexts

4.7: OR

  • Page ID
    23879
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    Instead of books with titles containing “SQL” and authored by Celko, suppose the end user wants a list of books with “SQL” in the title or where Celko is the author. In this situation we place the criteria on separate lines. MS Access ORs the criteria; a row is selected for the result set if either or both of the criteria are true for a row.

    Criteria on different criteria lines are ORed.
    Figure \(\PageIndex{1}\): Criteria on different criteria lines are ORed.

    Exercises

    Exercise \(\PageIndex{1}\)

    List the titles of books where the author name ends with “Celko”.

    Exercise \(\PageIndex{2}\)

    List the titles of books where the author name ends with “Celko” and the text “data” appears in the title.

    Exercise \(\PageIndex{3}\)

    List the titles of books where the author name ends with “Celko” or the text “data” appears in the title.

    Exercise \(\PageIndex{4}\)

    List titles of books where the title contains the word “medieval”.

    Exercise \(\PageIndex{5}\)

    List the titles of books where the title contains the words “medicine” and “medieval”.

    Exercise \(\PageIndex{6}\)

    List the titles of books where the title contains the words “medicine” or “medieval”.


    This page titled 4.7: OR is shared under a CC BY-NC-SA license and was authored, remixed, and/or curated by Ron McFadyen.

    • Was this article helpful?