Patrick Power Library

Boolean Operators: Writing Effective Search Statements

You can also learn how to search using Boolean logic with our brief online tutorial.

For effective database searching, it is important that you express your topic in a logical way that the computer will understand. While computer databases may differ in how they look and operate, most databases use the same commands for expressing the relationship between search terms. These commands are commonly referred to as Boolean operators.

There are three main Boolean operators: AND, OR, and NOT. Each one can be used to combine your search terms in different ways. They can also be used in combination, to create more complex search statements. In the examples below, the shaded area indicates the results that would be retrieved by each search statement.


AND is used between keywords with different meanings. AND will narrow a search.

Search Statement: drug abuse and teenagers

This search will retrieve only those records that contain all the words entered. That is, both the phrase "drug abuse" and the word "teenagers" must be present in each record retrieved.

 

OR is used between keywords that are similar or related in meaning (e.g., synonyms). OR will broaden a search.

Search Statement: crime or theft

This search will retrieve records that contain any of the words entered. The records may contain either the word "crime" or the related word "theft" and possibly (but not necessarily) both. As you can see by the shaded area, using OR broadens a search.

 

NOT (in some databases AND NOT) is used to eliminate concepts from a search. For example, if you wanted to find information about mental depression, a simple keyword search for "depression" would retrieve many results. Some results would deal with mental depression, but others might deal with such things as economic depression. To eliminate these unnecessary results, you can use the Boolean operator NOT.

Search Statement: depression not economic

As you can see by the shaded area above, this search would retrieve records that contain the word "depression." Of these documents, however, the computer would eliminate any that also contain the word "economic."

NOT should be used only when your initial searches are finding many inappropriate results. Otherwise, you may unintentionally eliminate useful items from your results.

 

Combining Boolean Operators

If you are using both AND and OR in a search, be sure to use parentheses to group together synonyms or related words for the same concept.  For example, a database search might look like this:

Some databases provide multiple search boxes that allow you to build a search query using Boolean operators. If that is the case, you do not need to enclose synonyms or related words in parentheses, simply enter all the terms relating to one concept in a search box separated by OR. For example:

 

 

For more detailed information on using Boolean operators, go to the Boolean Operators tutorial.

 


This page last modified Wednesday, 02-May-2012 14:39:33 ADT