Skip to Main Content
site header image

Database Search Tips: Boolean operators

Boolean operators

Overview

Be a Good Searcher for Information 

  • The key to being a savvy online searcher is to use common search techniques that you can apply to almost any database, including article databases, online catalogs and even commercial search engines.
  • This is important because searching library databases is a bit different from searching Google.
  • The techniques described in this section will enable you to quickly retrieve relevant information from the thousands of records in a database.
  • When you search a database and do not get the results you expect, ASK US for advice.  Library staff are happy to help you find what you need.

What to look for

Boolean operators form the basis of mathematical sets and database logic.

  • They connect your search words together to either narrow or broaden your set of results.
  • The three basic boolean operators are: AND, OR, and NOT.

Why use Boolean operators?

  • To focus a search, particularly when your topic contains multiple search terms.
  • To connect various pieces of information to find exactly what you're looking for.
  • Example: second creation (title) AND wilmut and campbell (author) AND 2000 (year)

Search order

Databases follow commands you type in and return results based on those commands. Be aware of the logical order in which words are connected when using Boolean operators: 

  • Databases usually recognize AND as the primary operator, and will connect concepts with AND together first.
  • If you use a combination of AND and OR operators in a search, enclose the words to be "ORed" together in parentheses.

Examples:

  • ethics AND (cloning OR reproductive techniques)
  • (ethic* OR moral*) AND (bioengineering OR cloning)

Using NOT

Use NOT in a search to: Image result for not

  • exclude words from your search
  • narrow your search, telling the database to ignore concepts that may be implied by your search terms 
  • example:  cloning NOT sheep

Using AND

Use AND in a search to:

  • narrow your results
  • tell the database that ALL search terms must be present in the resulting records
  • example: cloning AND humans AND ethics

The purple triangle in the middle of the Venn diagram below represents the result set for this search. It is a small set using AND, the combination of all three search words.

Be aware:  In many, but not all, databases, the AND is implied. 

  • For example, Google automatically puts an AND in between your search terms.
  • Though all your search terms are included in the results, they may not be connected together in the way you want.
  • For example, this search:  college students test anxiety  is translated to:  college AND students AND test AND anxiety. The words may appear individually throughout the resulting records.
  • You can search using phrases to make your results more specific by using quotations "around your words".   For example:  "college students" AND "test anxiety". This way, the phrases show up in the results as you expect them to be.

Using OR

Use OR in a search to:

  • connect two or more similar concepts (synonyms)
  • broaden your results, telling the database that ANY of your search terms can be present in the resulting records
  • example: cloning OR genetics OR reproduction

All three circles represent the result set for this search. It is a big set because any of those words are valid using the OR operator.

Truncation

What to look for

Image result for truncation symbol

  • Root words that have multiple endings.  Example: sun = suns, sunshine, sunny, sunlight
  • Words that are spelled differently, but mean the same thing.  Example:  color, colour
  • Truncation/wildcard symbols vary by database.  Check the help screens to find out which symbols are used.

Truncating the Word for Better Searches

*  Truncated Word Searches        

Advertis* = advertise, advertising, advertisement

Child* = child, children, childhood

Comput* = compute, computer, computers, computations, computational, computerized, computing, computable

Computer* = computer, computers

Gene* = gene, genes, genetics, geneticist, genetically

About truncation and wildcards

Truncation:  * 

Truncation, also called stemming, is a technique that broadens your search to include various word endings and spellings.

  • To use truncation, enter the root of a word and put the truncation symbol at the end.
  • The database will return results that include any ending of that root word.
  • Examples:
    child* = child, childs, children, childrens, childhood
    genetic* = genetic, genetics, genetically
  • Truncation symbols may vary by database; common symbols include: *, !, ?, or #

Image result for truncation symbol

Wildcards: $?!

Similar to truncation, wildcards substitute a symbol for one letter of a word.

  • This is useful if a word is spelled in different ways, but still has the same meaning.
     
  • Examples:
    wom!n = woman, women
    colo?r = color, colour

If you have questions about applying this technique to your search, Ask Us!

Keywords vs. subjects

What to look for

Subject Headings

To find subject headings for your topic:

  • Look to see if the database has an online thesaurus to browse for subjects that match your topic (check the Help screens).

Another way to find subject headings:

  • Start with a keyword search, using words/phrases that describe your topic.
  • Browse the results; choose 2 or 3 that are relevant.
  • Look at the Subject or Descriptor field and note the terms used (write them down).
  • Redo your search using those terms.
  • Your results will be more precise than your initial keyword search.

What are subject headings and keywords?

Subject headings describe the content of each item in a database. Use these headings to find relevant items on the same topic.  Searching by subject headings (a.k.a. descriptors) is the most precise way to search article databases.

It is not easy to guess which subject headings are used in a given database. For example, the phone book's Yellow Pages use subject headings. If you look for "Movie Theaters" you will find nothing, as they are listed under the subject heading "Theaters - Movies."

Keyword searching is how you typically search web search enginesThink of important words or phrases and type them in to get results.

Here are some key points about each type of search:

Keywords
vs.
Subjects
  • natural language words describing your topic - good to start with
 
  • pre-defined "controlled vocabulary" words used to describe the content of each item (book, journal article) in a database
  • more flexible to search by - can combine together in many ways
 
  • less flexible to search by - need to know the exact controlled vocabulary term
  • database looks for keywords anywhere in the record - not necessarily connected together
 
  • database looks for subjects only in the subject heading or descriptor field, where the most relevant words appear
  • may yield too many or too few results
 
  • if too many results - also uses subheadings to focus on one aspect of the broader subject
  • may yield many irrelevant results
 
  • results usually very relevant to the topic

When you search a database and do not get the results you expect, ASK US for advice.

Phrases/Stop Words

PHRASES: What to look for

Different databases interpret searches differently. A common variation is how databases recognize phrases.

  • Some assume that words typed next to each other should be searched as phrases.
  • Others automatically put a Boolean AND between your search terms, requiring that all the words be present, but not necessarily adjacent to each other.
  • These searches can retrieve very different results.

Know how your database searches, check in the information section of your database

Phrase searching tips

Most databases allow you to specify that adjacent words be searched as phrases.

  • Using parentheses or quotes around search words is a common way to do phrase searching, but not all databases or search engines use them.
  • Example:  "genetic engineering"
  • Hint: It is often very easy to do phrase searching from the Advanced or Guided search in a database.
  • You can click a button specifying that you want your words searched as a phrase, as in the example below:

 

About stop words

Why should you care about stop words?

  • Many databases ignore common words from your search statement.  If included, the database returns far too many results.
  • So you know which words to exclude from your search statement.
  • To make sure they are included if they are a significant part of your search.
  • Many databases recognize common stop words when they are part of the controlled vocabulary of subject headings and descriptors.  Example: balance of payments
  • Stop words vary by database. Check the Help screens for a list.

How can you avoid using stop words in your search?

  • In some databases, you can use techniques to include stop words as part of the search.
  • Some databases use quotes around stop words.  Example: Title keyword= out "of" Africa retrieves title: Out of Africa
  • Choose the most significant words that describe your topic and connect them together using Boolean operators or proximity operators.

  • Search for your terms in specific fields, such as author, title or subject/descriptor.

Proximity operator examples

Many databases allow you to specify that the words you are searching are within a certain proximity of each other.

  • Proximity operators are more specific than Boolean operators and make your search more precise.

Proximity operators also vary by database, but some common ones include:

w# = with

  • With specifies that words appear in the order you type them in.
  • Substitute the # with a number of words that may appear in between. If no number is given, then it specifies an exact phrase.
  • Examples: genetic w engineering (searches the phrase genetic engineering)
  • Hillary w2 Clinton (retrieves Hillary Clinton, Hillary Rodham Clinton, etc.)

n# = near

  • Near specifies that the words may appear in any order.
  • Substitute the # with a number of words that may appear in between.
  • Examples: cloning n3 human (retrieves cloning of humans, human cloning etc.)

Consult the database Help screens to find out how to search by phrases or to specify proximity.  You can also Ask Us for advice on searching phrases.

Fields

What to look for

Records in library databases are comprised of fields containing specific pieces of bibliographic information. Common fields include:

  • author
  • title
  • journal title
  • abstract
  • publisher
  • date/year of publication
  • subject/descriptor

Example of fields

The record belows shows the field names on the left: Author, Title, Source, Standard No., Details, Language, Abstract, Descriptor

How database fields improve your search

Limiting your search to specific database fields can yield more precise results.

  • For instance, if you are looking for books by Adam Smith instead of about him, it is more efficient to limit your search to the author field.
  • To find various fields within a database, look for drop down boxes or menus to select the field you want to search.
  • Then combine words and fields together with boolean or proximity operators, depending on how precise you want to be.

  • If you do not choose a specific field, the database usually reverts to a keyword search, where your words will be searched throughout the record.
  • If your keyword search retrieves too many records (more than 50), try narrowing your search to retrieve a more manageable result.
  • Information overload - too many results - can be a worse situation than finding only 10 very relevant results.

Need help understanding fields? ASK US!