A query is a question, often expressed in a formal way. A database query can be either a select query or an action query. A select query is a data retrieval query, while an action query asks for additional operations on the data, such as insertion, updating or deletion.

Query language

Query languages are used to make queries in a database, and Microsoft Structured Query Language (SQL) is the standard. Under the SQL query umbrella, there are several extensions of the language, including MySQL, Oracle SQL and NuoDB. Query languages for other types of databases, such as NoSQL databases and graph databases, include Cassandra Query Language (CQL), Neo4j's Cypher, Data Mining Extensions (DMX) and XQuery.

Queries can accomplish a few different tasks. Primarily, queries are used to find specific data by filtering specific criteria. Queries can also calculate or summarize data, as well as automate data management tasks. Other queries include parameter, totals, crosstab, make table, append, update and delete. For example, a parameter query runs variations of a particular query, which prompts a user to insert a field value, and then it uses that value to create the criteria, while totals queries allow users to group and summarize data.

SQL query example
An example of SQL query

In a relational database, which contains records or rows of information, the SQL SELECT statement query allows the user to choose data and return it from the database to an application. The resulting query is stored in a result-table, which is called the result-set. The SELECT statement can be broken down into other categories, such as FROM, WHERE and ORDER BY. The SQL SELECT query also can group and aggregate data, such as summarize or analyze.

Web search query

The text typed into search engines, such as Bing, Google or Yahoo, is called a query. Search-engine queries provide information that is much different from SQL languages because they don't require keyword or positional parameters. A search-engine query is a request for information on a particular topic, and the request is made once a user selects 'Enter.'

Once the request is made, the search engine uses an algorithm to determine the best results, which are sorted based on significance according to the search engine -- details of which are not revealed publicly.

Types of search queries include navigational, informational and transactional. Navigational searches are intended to find a particular website, such as; informational searches are designed to cover a broad topic, such a comparison between a new iPhone and Android device; and transactional searches seek to complete a transaction, such as the purchase of a new sweater on

This was last updated in March 2017

Continue Reading About query

Dig Deeper on SQL-Transact SQL (T-SQL)