Every time you type a few words into a library catalogue, an academic database, or even a search engine, you are running a query. But typing random keywords often returns thousands of irrelevant results or, worse, almost nothing useful. The real skill lies in telling the database exactly how your terms relate to each other. This is where compound queries come in. By stringing together multiple search terms with special connecting words called Boolean operators, you can build precise, powerful searches that pull out exactly what you need. Whether you are a library science student, a researcher, or simply someone trying to find a specific journal article, mastering these operators will change how you search forever.
Table of Contents
What are compound queries
A compound query is a search that combines two or more terms using logical connectors. Instead of searching for a single keyword, you join several concepts together to define the exact relationship you want between them. The connectors that make this possible are called Boolean operators, and the three most important ones are AND, OR, and NOT. These operators allow you to form compound searches by combining two or more terms together, which is the foundation of effective database searching.
The term “Boolean” comes from George Boole, the nineteenth-century English mathematician whose algebra of logic became the basis for the design of digital computer circuits. Boole reduced logical reasoning to a simple algebra in his 1854 work, An Investigation of the Laws of Thought. His ideas were largely ignored during his lifetime and were only fully appreciated decades later when others realised that electromechanical circuits could solve Boolean algebra problems. Today, that same logic powers everything from your smartphone to the search box in a university library portal.
Boolean operators: the building blocks
Before constructing complex searches, you need to understand what each operator does on its own. The operator you choose directly controls whether your search expands to include more results or narrows down to fewer, more focused ones. The operator you select determines whether the number of results you retrieve is increased or decreased, so picking the right one for the right purpose is essential.
A small but important detail: in most databases, Boolean operators must be typed in capital letters. Boolean operators are case-sensitive and must be typed in all capital letters to function properly, otherwise the database may treat them as ordinary search words.
AND: narrowing your search
The AND operator tells the database that you want only those records that contain all of your search terms. It is the operator of precision. The AND operator narrows your search query by only returning hits that include all your search terms, which lets you link different concepts together.
For example, if you search for libraries AND digitisation, the database will return only records that discuss both libraries and digitisation. Articles that mention libraries but say nothing about digitisation will be excluded, and so will articles about digitisation in other fields. The more terms you connect with AND, the smaller and more focused your result set becomes. This is the operator to reach for when your topic involves two or more distinct ideas that must appear together.
OR: broadening your search
The OR operator does the opposite of AND. It widens your search by retrieving records that contain any of your terms. The OR operator allows you to broaden a concept and include synonyms, and the more keywords you OR together, the more records you will retrieve. This makes OR ideal for handling synonyms and related terms.
Many concepts can be expressed in different words. A topic about films might also be written as movies or cinema. If you search for just one word, you miss every record that uses the others. By searching films OR movies OR cinema, you capture all of them in a single query. OR ensures that differences in vocabulary between authors do not cause you to overlook relevant sources.
NOT: excluding terms
The NOT operator removes unwanted results from your search. It tells the database to find records containing one term but to exclude any that also contain another. The NOT operator narrows your search query by omitting any result that includes a specific search term.
Imagine you are researching the fruit and keep getting technology results. A search for apple NOT computer would strip out the technology articles. However, NOT must be used with caution. If you search for dementia NOT Alzheimer’s, you will eliminate every record discussing Alzheimer’s, including those that discuss both types of dementia together. Because NOT removes records entirely, it can accidentally discard useful sources that mention the excluded term only in passing. Use it sparingly and only when you are sure the excluded term has no value to your topic.
Combining operators with nesting
The real power of compound queries appears when you mix operators in a single search. This technique is called nesting, and it uses parentheses to group terms together. Nesting clarifies relationships between terms, isolates parts of a query, and specifies the order a search should run, since terms in parentheses are prioritised.
Suppose you want articles about public libraries that discuss either children or teenagers. You could write: public libraries AND (children OR teenagers). The database first processes the part inside the parentheses, finding every record about children or teenagers, and then applies AND to keep only those that also mention public libraries. Without the parentheses, the logic of the search could change completely and return the wrong results.
Why order matters
When several operators appear in one query, the database follows a fixed sequence to decide which to process first. This sequence is called operator precedence, and ignoring it leads to confusing results. The default search order is that OR processes before AND, which processes before NOT, but parentheses tell the search engine to look inside them before taking any other step.
The simplest way to remember the rule is that parentheses behave just like brackets in mathematics. Just as multiplication is processed before addition in an equation, search engines use a similar concept of precedence to process AND, OR, NOT and brackets, with the content of the brackets handled first. Because the exact order can differ from one database to another, always use parentheses to make your intentions explicit rather than relying on the database to guess correctly.
A worked example
Consider a research topic on the impact of social media on reading habits among students. You might begin by listing synonyms for each concept. For social media you could use social media OR Facebook OR Instagram. For reading you could use reading OR literacy. Combining these into one nested query gives: (social media OR Facebook OR Instagram) AND (reading OR literacy) AND students.
The database evaluates each parenthetical group first, then joins the groups with AND. The result is a focused set of records that touch on all three of your core concepts while still accounting for vocabulary variations within each one. This single compound query does the work of dozens of separate searches.
Beyond the three operators
Once you are comfortable with AND, OR, and NOT, two related tools make compound queries even sharper. The first is quotation marks, used to search for an exact phrase. When you place quotation marks around terms, your results return only items that include those exact words in that exact order. Searching “information literacy” as a phrase is far more precise than searching the two words separately.
The second tool is the default behaviour of spaces. In many databases, a space between two words is automatically treated as AND. In a simple query where operators are not used, spaces between words are treated as an implied AND, so the results contain documents holding all the words entered. Knowing this helps you understand why typing several keywords without any operator still narrows your results rather than broadening them.
Putting it into practice
Compound queries work across almost every serious search tool, from academic databases like JSTOR and Web of Science to library catalogues and discovery layers used in universities. The principles remain the same regardless of the platform. Start by breaking your topic into separate concepts, list the synonyms for each concept and join them with OR, then connect the different concepts with AND, and finally use NOT only when you genuinely need to exclude something.
One word of caution applies to every database: the precise rules can vary. Because search engines constantly update their algorithms and operators, it is wise to check the specific help page of whichever database you are using. A quick look at the search tips section will tell you exactly how that system handles operators, precedence, and phrases.
With these techniques, you move from guessing to searching with intent. A well-constructed compound query saves hours of scrolling through irrelevant hits and helps you reach the precise sources your research demands.
What do you think? Think about the last research topic you searched for. How would you rewrite it as a compound query using AND, OR, and NOT to get sharper results? And which operator do you think students most often forget to use when they should?
References
- https://libguides.usask.ca/c.php?g=16394&p=90472
- https://www.britannica.com/biography/George-Boole
- https://www.storyofmathematics.com/19th_boole.html/
- https://libguides.ouhsc.edu/searching/boolean
- https://support.jstor.org/hc/en-us/articles/115004733187-Searching-Boolean-Operators
- https://data.ecb.europa.eu/help/search/combining-search-terms-boolean-operators
- https://libguides.umn.edu/BooleanOperators
- https://libguides.bc.edu/advancedsearch/parentheses
- https://law-msu.libguides.com/c.php?g=913167&p=6580617
- https://libguides.bcu.ac.uk/searching/nesting-boolean-operators
- https://www.govinfo.gov/help/search-operators
- https://medium.com/@nammooo/the-boolean-order-of-operations-precedence-rules-72bd486bc19

Leave a Reply