# Query language

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Query_language
> Markdown URL: https://mediated.wiki/source/Query_language.md
> Source: https://en.wikipedia.org/wiki/Query_language
> Source revision: 1340615070
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

{{Short description|Computer language used to make queries into databases and information systems}}
{{Multiple issues|
{{more citations needed|date=October 2010}}
{{lacking overview|date=April 2018}}
}}

A '''query language''', also known as '''data query language''' or '''database query language''' ('''DQL'''), is a [computer language](/source/computer_language) used to make queries in [database](/source/database)s and [information system](/source/information_system)s. In database systems, query languages rely on strict theory to retrieve information.<ref>{{Cite journal |last=Schmitt |first=Ingo |date=January 2008 |title=QQL: A DB&IR Query Language |url=https://link.springer.com/article/10.1007/s00778-007-0070-1 |journal=The VDLB Journal 17 |volume=17 |pages=39–56 |doi=10.1007/s00778-007-0070-1 |s2cid=207032530 |via=ACM Digital Library|url-access=subscription }}</ref> A well known example is the [Structured Query Language](/source/Structured_Query_Language) (SQL).

==Types==
Broadly, query languages can be classified according to whether they are ''database'' query languages or ''information retrieval'' query languages. The difference is that a '''database query language''' attempts to give factual answers to factual questions, while an '''information retrieval query language''' attempts to find documents containing information that is relevant to an area of inquiry. Other types of query languages include:

* '''Full-text'''. The simplest query language is treating all terms as bag of words that are to be matched with the postings in the [inverted index](/source/inverted_index) and where subsequently ranking models are applied to retrieve the most relevant documents. Only tokens are defined in the CFG. Web search engines often use this approach.
* '''Boolean'''. A query language that also supports the use of the [Boolean operator](/source/logical_connective)s AND, OR, NOT. 
* '''Structured'''. A language that supports searching within (a combination of) fields when a document is structured and has been indexed using its document structure. 
* '''Natural language'''. A query language that supports natural language by parsing the natural language query to a form that can be best used to retrieve relevant documents, for example with [Question answering](/source/Question_answering) systems or [conversational search](/source/conversational_search).

==Examples==

* [Attempto Controlled English](/source/Attempto_Controlled_English) is a query language that is also a [controlled natural language](/source/controlled_natural_language).<ref name="FLAIRS 2006">{{cite conference |author1=Norbert E. Fuchs |author2=Kaarel Kaljurand |author3=Gerold Schneider | title = Attempto Controlled English Meets the Challenges of Knowledge Representation, Reasoning, Interoperability and User Interfaces | book-title = FLAIRS 2006 | date = 2006 | url = http://attempto.ifi.uzh.ch/site/publications/papers/FLAIRS0601FuchsN.pdf }}</ref>
* [AQL](/source/AQL_(ArangoDB_Query_Language)) is a query language for the [ArangoDB](/source/ArangoDB) native multi-model database system.
* [.QL](/source/.QL) is a proprietary object-oriented query language for querying [relational database](/source/relational_database)s; successor of Datalog.
* [CodeQL](/source/CodeQL) is the analysis engine used by developers to automate security checks, and by security researchers to perform variant analysis on [GitHub](/source/GitHub).
* [Contextual Query Language](/source/Contextual_Query_Language) (CQL) a formal language for representing queries to [information retrieval](/source/information_retrieval) systems such as web indexes or bibliographic catalogues.
* [Cypher](/source/Cypher_Query_Language) is a query language for the [Neo4j](/source/Neo4j) graph database.
* [DMX](/source/Data_Mining_Extensions) is a query language for [data mining](/source/data_mining) models.
* [Datalog](/source/Datalog) is a query language for [deductive database](/source/deductive_database)s.
* [F-logic](/source/F-logic) is a declarative object-oriented language for [deductive database](/source/deductive_database)s and [knowledge representation](/source/knowledge_representation).
* [FQL](/source/Facebook_Query_Language) enables you to use a [SQL](/source/SQL)-style interface to query the data exposed by the [Graph API](/source/Graph_API). It provides advanced features not available in the [Graph API](/source/Graph_API).<ref>{{cite web|url=https://developers.facebook.com/docs/technical-guides/fql/|title=FQL Overview|work=Facebook Developers|access-date=2013-12-11|archive-url=https://web.archive.org/web/20131218130320/https://developers.facebook.com/docs/technical-guides/fql/|archive-date=2013-12-18|url-status=dead}}</ref>
* Gellish English is a language that can be used for queries in Gellish English Databases, for dialogues (requests and responses) as well as for information modeling and [knowledge modeling](/source/knowledge_modeling).<ref>https://gellish.wiki.sourceforge.net/Querying+a+Gellish+English+database{{dead link|date=July 2016 |bot=InternetArchiveBot |fix-attempted=yes }}</ref>
* [Gremlin](/source/Gremlin_(programming_language)) is an [Apache Software Foundation](/source/Apache_Software_Foundation) graph traversal language for OLTP and OLAP graph systems.
* [GraphQL](/source/GraphQL) is a data query language developed by [Facebook](/source/Facebook) as an alternate to [REST](/source/REST) and ad-hoc [webservice](/source/webservice) architectures.
* [HTSQL](/source/HTSQL) is a query language that translates [HTTP](/source/HTTP) queries to [SQL](/source/SQL).
* [ISBL](/source/ISBL) is a query language for [PRTV](/source/PRTV), one of the earliest relational database management systems.
* [Jaql](/source/Jaql) is a functional data processing and query language most commonly used for JSON query processing.
* [JPQL](/source/Jakarta_Persistence_Query_Language) is a query language defined as part of [Jakarta Persistence](/source/Jakarta_Persistence) (used in [Java](/source/Java_(programming_language)) applications to make queries to a [relational DB](/source/relational_DB) using entity objects instead of DB tables).
* [jq](/source/Jq_(programming_language)) is a functional programming language often used for processing queries against one or more [JSON](/source/JSON) documents, including very large ones.
* [JSONiq](/source/JSONiq) is a declarative query language designed for collections of [JSON](/source/JSON) documents.
* KQL (Kusto Query Language), a query language by [Microsoft](/source/Microsoft) used in [Azure Data Explorer](/source/Azure_Data_Explorer)
* [LDAP](/source/LDAP) is an [application protocol](/source/application_protocol) for querying and modifying [directory services](/source/directory_services) running over [TCP/IP](/source/TCP%2FIP).
* LogiQL is a variant of Datalog and is the query language for [the LogicBlox system](/source/LogicBlox).
* [M Formula language](/source/M_Formula_language), a [mashup](/source/Mashup_(web_application_hybrid)) query language used in Microsoft's Power Query.
* [MQL](/source/Molecular_Query_Language) is a [cheminformatics](/source/cheminformatics) query language for a [substructure search](/source/substructure_search) allowing beside nominal properties also numerical properties.
* [MDX](/source/MultiDimensional_eXpressions) is a query language for [OLAP](/source/OLAP) databases.
* [N1QL](/source/N1QL) is a [Couchbase](/source/Couchbase%2C_Inc.)'s query language finding data in [Couchbase Server](/source/Couchbase_Server)s.
* [Object Query Language](/source/Object_Query_Language)
* [OCL](/source/Object_Constraint_Language) (Object Constraint Language). Despite its name, OCL is also an object query language and an [OMG](/source/Object_Management_Group) standard.
* [OPath](/source/OPath), intended for use in querying [WinFS](/source/WinFS) ''Stores''.
* [Poliqarp Query Language](/source/Poliqarp_Query_Language) is a special query language designed to analyze annotated text. Used in the [Poliqarp](/source/Poliqarp) search engine.
* PQL is a [special-purpose programming language](/source/special-purpose_programming_language) for managing [process model](/source/process_model)s based on information about [scenarios](/source/wiktionary%3AScenario) that these models describe.
* PRQL [https://prql-lang.org/ PRQL] (Pipelined Relational Query Language) is a modern language for transforming data. Consists of a curated set of orthogonal transformations, which are combined together to form a pipeline.
* [PTQL](/source/PTQL) based on relational queries over program traces, allowing programmers to write expressive, declarative queries about program behavior.
* [QUEL](/source/QUEL_query_languages) is a [relational database](/source/relational_database) access language, similar in most ways to [SQL](/source/SQL).
* [RDQL](/source/RDQL) is a [RDF](/source/Resource_Description_Framework) query language.
* [SMARTS](/source/Smiles_arbitrary_target_specification) is the [cheminformatics](/source/cheminformatics) standard for a [substructure search](/source/substructure_search).
* [SPARQL](/source/SPARQL) is a query language for [RDF](/source/Resource_Description_Framework) [graphs](/source/Graph_(discrete_mathematics)).
* [SQL](/source/SQL) is a well-known query language and [data manipulation language](/source/data_manipulation_language) for [relational database](/source/relational_database)s.
* [XQuery](/source/XQuery) is a query language for [XML data sources](/source/XML_database).
* [XPath](/source/XPath) is a declarative language for navigating XML documents.
* [YQL](/source/Yahoo!_Query_Language) is an [SQL](/source/SQL)-like query language created by [Yahoo!](/source/Yahoo!).
* Search engine query languages, e.g., as used by [Google](/source/Google_Search).<ref>
{{cite web
| title = Search operators
| url = https://support.google.com/websearch/answer/2466433?hl=en
| access-date = August 22, 2015
| publisher = Google Inc.
}}</ref> or [Bing](/source/Bing_(search_engine))<ref>
{{cite web
| title = Bing Query Language
| date = 22 June 2010
| url = https://msdn.microsoft.com/en-us/library/ff795667.aspx
| access-date = August 22, 2015
| publisher = Microsoft
}}</ref>

== See also ==
* [Data control language](/source/Data_control_language)
* [Data definition language](/source/Data_definition_language)
* [Data manipulation language](/source/Data_manipulation_language)
* [Path expression](/source/Path_expression)

== References ==
{{Reflist}}

{{Database}}
{{Databases}}
{{Computer language}}
{{Query languages}}
{{Programming paradigms navbox}}

{{Authority control}}

Category:Query languages
Category:Computer languages
Category:Data management
Category:Programming language classification
Category:Database management systems

---
Adapted from the Wikipedia article [Query language](https://en.wikipedia.org/wiki/Query_language) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Query_language?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
