Boolean logic is used in databases during their searches to decide what to include or exclude from the search. It is based off of the ideas behind deductive reasoning.
For example, if you search for dog you get many results. If you are looking for a specific type of dog, then it makes sense to narrowly specify which you want: black dog. Results for blue dog would be illogical and excluded.
Boolean Operators (AND, OR, NOT) are a search technique that allows you to tell the database how you want your keywords to be connected in the search. You can use them to narrow, broaden, or exclude in your results. You choose which to use based on what is logical to include or exclude for your specific need.
Since you cannot use full sentences or questions, the Boolean Operators (AND, OR, NOT) allow you to communicate your need in a way the database understands.
The Boolean Operators you use impact your results heavily. Look at the difference in the number of results in the following three searches using the keywords yoga, stress, all done in the database Research Library (ProQuest):
yoga AND stress |
|
yoga OR stress |
|
yoga NOT stress |
|
Each Boolean Operator performs a different action, which means they each would be used in a particular situation. Note the Boolean Operators should be in all caps; many databases will not recognize them otherwise.
AND retrieves records that contain all the search terms entered. All the results you see will contain all of the keywords you specified. Thus, AND narrows a search. The more terms you connect with AND, the narrower and more focused your search becomes. For this reason, you want to use AND when connecting different ideas.
Here are some examples:
art therapy AND children
hacking AND security
lead AND drinking water
OR retrieves all records that contain at least one of the search terms entered. If any of the terms are found, that item will show up in your list of results. Thus, OR broadens your search. In other words: OR is more! For this reason, you want to use OR when connecting similar ideas.
Here are some examples:
lawyers OR attorneys
teenagers OR adolescents
drug abuse OR substance abuse
NOT excludes a term from your search. If that term is found, the item will not show up in your list of results. Thus, NOT can narrow your search.
NOT should be used cautiously! It can sometimes eliminate desired records from your results if a record happens to contain both terms in a way you may not anticipate.
NOT is commonly used when a word has more than one definition and you would like to exclude meanings not relevant to your search.
Here are some examples:
mine NOT explosive
bat NOT baseball
kid NOT goat
Nesting is an advanced search technique that allows you to group your search terms and to dictate the order in which the Boolean operators will be carried out. Specifically, everything within the parentheses is searched first.
Most databases carry out your search terms moving from left to right unless you say otherwise. This can lead to many unwanted items.
It is especially important to use nesting when your search statement contains similar terms connected by the OR operator.
For example, here is a search for smoking AND teenagers OR adolescents in Academic Search Complete. Look at the total number of results – over 240 thousand!
At first, that may not seem too bad. However, when we look at the most recent articles from this search some talk about adolescents without mentioning smoking. Those aren’t relevant to our need.
Here’s a search for smoking AND (teenagers OR adolescents). Now the computer will search first for the items within the parentheses. It will find all records containing the terms “teenagers” or “adolescents.” Next, it will take those results and only retrieve the records that also contain the term “smoking.”
You can see the number of results have decreased dramatically to just over 8 thousand.
Even the most recent articles connect smoking with either teenagers or adolescents, making the results more relevant.
If you want to use multiple search boxes, you should keep your nested terms together in the same box, as in the example below. Some databases will automatically nest the search terms placed in a single box, but others won’t. It’s good to include the parentheses just in case!