A query language is an artificially created programming language used to make queries in databases and information systems.
In general, such query methods can be classified depending on whether they serve for a database or for information retrieval. The difference is that requests to similar services are made to get actual answers to the questions posed, while the search engine tries to find documents containing information related to the area of interest to the user.
Database
Database query languages include the following examples:
- QL - object-oriented, refers to relational databases; successor to Datalog.
- Contextual (CQL) is a formal query presentation language for information retrieval systems (such as web indexes or bibliographic directories).
- CQLF (CODYASYL) - for CODASYL-TYPE databases.
- Concept-oriented query language (COQL) - used in the corresponding models (com). It is based on the principles of construpt data modeling and uses operations such as projection and de-projection of multivariate analysis, analytical operations and conclusions.
- DMX - Used for data mining models .
- Datalog is a query language for deductive databases.
- Gellish English is a language that can be used for queries to the Gellish English databases and allows you to conduct dialogs (queries and answers), and also serves for information modeling of knowledge.
- HTSQL - translates http queries to SQL.
- ISBL - used for PRTV (one of the first relational database management systems).
- LDAP is the TCP / IP protocol for queries and directory services.
- MDX - required for OLAP databases.

Search engines
The language of search queries, in turn, is aimed at finding data in search engines. It differs in that often queries contain plain text or hypertext with additional syntax (for example, “and” / “or”). It differs significantly from standard similar languages, which are regulated by strict rules of command syntax or contain positional parameters.
How are search queries classified?
There are three broad categories that cover most searches: informational, navigation, and transactional. Although this classification was not fixed theoretically, it is empirically confirmed by the presence of actual queries in search engines.
Information requests are those that cover broad topics (for example, a specific city or truck model) for which thousands of relevant results can be obtained.
Navigation - these are queries that are looking for one site or web page on a specific topic (for example, YouTube).
Transactional - reflect the user's intention to perform a specific action, for example, make a car purchase or book a ticket.
Search engines often support the fourth type of query, which is used much less frequently. These are the so-called connection requests that contain a report on the connectivity of the indexed web graph (the number of links to a specific URL, or how many pages are indexed from a specific domain).
How is information searched?
Most search resources do not disclose their search logs, so it’s very difficult to find information about what users search on the Web. Nevertheless, the first scientific studies appeared in 1998. A follow-up study was later conducted in 2001, which analyzed queries that appear to be highly relevant. It also became clear how the search language is used by search robots .
Interesting features related to web search became known:
The average search query length was 2.4 words.
- About half of the users sent one request, and a little less than a third of the users made three or more unique requests one by one.
- Almost half of the users viewed only the first one or two pages of the results.
- Less than 5% of users use advanced search capabilities (for example, selecting specific categories or searching in search).
Custom action features
The study also found that 19% of queries contained a geographic term (for example, names, zip codes, geographic features, etc.). It is also worth noting that in addition to short queries (that is, with several conditions), there were often predictable patterns by which users changed their search phrases.
It was also found that 33% of requests from one user are repeated, and in 87% of cases the user will click on the same result. This suggests that many users use repeat queries to revise or rediscover information.
Request Frequency Distributions
In addition, experts have confirmed that the frequency distribution of requests corresponds to a power law. That is, a small part of the keywords is observed in the largest list of queries (for example, more than 100 million), and they are most often used. The remaining phrases within the same topics are used less frequently and more individually. This phenomenon was called the Pareto principle (or the “80-20 rule”), and it allowed search engines to use optimization methods such as indexing or partitioning the database, caching and proactive loading, and also made it possible to improve the search engine query language.
In recent years, it has been found that the average length of requests has steadily increased over time. So, the average query in English has become longer. In this regard, Google introduced an update called Hummingbird (in August 2013), which is able to handle long search phrases with a non-protocol, “spoken” query language (like “where is the nearest coffee shop?”).
For longer queries, their processing is used - they are divided into phrases formulated in a standard language, and answers to different parts are displayed separately.
Structured queries
Search engines that support logical operations and syntax use more advanced query languages. A user who is looking for documents covering several topics or faces can describe each of them according to the logical characteristics of the word. At its core, the logical language of queries is a combination of certain phrases and punctuation marks.
What is advanced search?
The query language of Yandex and Google is able to perform a more narrowly targeted search subject to certain conditions. Advanced search can search by page title or title prefix, as well as in certain categories and lists of names. It can also limit the search for pages that contain certain words in the title or are located in certain thematic groups. With proper use of the query language, it can process parameters that are an order of magnitude more complex than the superficial results of most search engines, including for user-defined words with a variable ending and similar spelling. When presenting advanced search results, a link to the relevant sections of the page will be displayed.
It is also the ability to search all pages containing a certain phrase, while with a standard query, search engines cannot stop on any discussion page. In many cases, the query language can lead to any page located in noindex tags.
In some cases, a correctly formed query allows you to find information containing a number of special characters and letters of other alphabets (Chinese characters for example).
How are query language characters read?
Upper and lower case, as well as some diacritics (umlauts and accents) are not taken into account in searches. For example, a search on the Citroen keyword will not find pages containing the word "Citroen." But some ligatures correspond to individual letters. For example, a search for the word “aeroscobing” will easily find pages containing “Ereskebing” (AE = Æ).
Many non-alphanumeric characters are constantly ignored. For example, it is not possible to find information on a query containing the string | L | (letter between two vertical stripes), despite the fact that this symbol is used in some conversion templates. The results will only include data from LT. Some characters and phrases are processed differently: the query “credit (Finance)” displays articles with the words “credit” and “finance”, ignoring the brackets, even if there is an article with the exact name “credit (Finance)”.
There are many features that can be used using the query language.
Syntax
The query language of Yandex and Google may use some punctuation to refine the search. As an example, you can use curly braces - {{search}}. The phrase enclosed in them will be searched in its entirety, unchanged.
The phrase in double quotes allows you to determine the object of the search. For example, a word in quotation marks will be recognized as used figuratively or as a fictional character, without quotation marks as information of a more documentary nature.
In addition, all major search engines support the symbol “-” for the logical “not”, as well as and / or. An exception is terms that cannot be separated using a prefix with a hyphen or dash.
Inaccurate search phrase matching is indicated by the ~ symbol. For example, if you do not remember the exact wording of the term or name, you can specify it in the search bar with the specified character, and you can get results that have the maximum similarity.
Custom Search Options
There are also search options such as intitle and incategory. They are filters displayed through the colon in the form of "filter: query string". The query string can contain the search term or phrase, or the part or full name of the page.
The "intitle: query" function gives priority to search results by name, but also shows the usual results for the content of the header. Several of these filters can be used simultaneously. How to use this opportunity?
A request of the form “intitle: airport name” will return all articles containing the airport name in the title. If you formulate it as “parking intitle: the name of the airport”, then you will receive articles with the name of the airport in the title and with the mention of parking in the text.
Searching for the “incategory: Category” filter works on the basis of the initial issue of articles belonging to a specific group or list of pages. For example, a search query such as “Temples incategory: History” will return results on the history of temples. This function can also be used as advanced, setting various parameters.