Search CTRL + K

Query Language

查询语言数据库管理系统 提供给用户和 数据库 交互的工具。


查询语言 可以归纳为三类:命令式、函数式和声明式。


实践中的 查询语言,比如 SQL,会同时包含多种 查询语言 的特性。[1]






用户只声明需要的数据,由 数据库管理系统 实现计算过程并返回数据。

Database System Concepts

A query language is a language in which a user requests information from the database. Query languages can be categorized as imperative, functional, or declarative.[2]

Database System Concepts

In an imperative query language, the user instructs the system to perform a specific sequence of operations on the database to compute the desired result; such languages usually have a notion of state variables, which are updated in the course of the computation.[2:1]

Database System Concepts

In a functional query language, the computation is expressed as the evaluation of functions that may operate on data in the database or on the results of other functions; functions are side-effect free, and they do not update the program state.[2:2]

Database System Concepts

In a declarative query language, the user describes the desired information without giving a specific sequence of steps or function calls for obtaining that information; the desired information is typically described using some form of mathematical logic. It is the job of the database system to figure out how to obtain the desired information.[2:3]

  1. ↩︎

  2. Abraham Silberschatz, Henry F. Korth, and S. Sudarshan, Database System Concepts, Seventh edition (New York, NY: McGraw-Hill, 2020). P47 ↩︎ ↩︎ ↩︎ ↩︎