EarlyBeijing website productionRelational operation capability is usually expressed in an algebraic or logical way, which is called relational algebra and relational calculus respectively. Relational algebra is a way to express query requirements by relational operations.Relational calculus is a way to express query requirements with predicates. It can be divided into tuple relational calculus and domain relational calculus according to whether the basic object of predicate variable is tuple variable or domain variable.Relational algebra, tuple relational calculus and domain relational calculus are equivalent in terms of expression ability.
Relational algebra, tuple relational calculus and domain relational calculus are all abstract query languages. These abstract languages are not exactly the same as the actual languages implemented in the concrete DBMS, but they can be used as the standard or basis for evaluating the query language ability in the actual system. The actual query language provides many additional functions besides relational algebra or relational calculus,Such as set function, relation assignment and arithmetic operation.
In addition, there is a structured query language between relational algebra and relational calculusSQL not only has rich query functions, but also has data definition and data control functions. It is a relational data language integrating query, DDL (data definition language), DML (data manipulation language) and DCL (data control language). It is the standard language of relational databases.
Therefore, relational data languages can be divided into the following three categories:
(1) Relational algebra language, that is, the language that expresses the query requirements with relational operationsISBL (information system base language) is the representative of relational languages.
(2) Relational calculus language, that is, a language in which the tuple obtained from the query should meet the predicate condition to express the query requirements.Relational calculus language can be divided into tuple relational calculus language and domain relational calculus language. The basic object of predicate argument of tuple relational calculus language is tuple variable, such as APLHA, QUEL language;The basic object of predicate argument of domain relational calculus language is domain variable, and QBE (query by example) is a typical domain relational calculus language.
(3) A language with the dual characteristics of relational algebra and relational calculus. Its typical representative is the structured query language SQL, which includes data definition, data operation and data control functions. With the characteristics of simple language, easy to learn and use, SQL is the standard language and mainstream language of relational databases.The common feature of these relational data languages is that they have complete expression ability, are non procedural set operation languages, have strong functions, and can be embedded in high-level languages.
Relational language is a highly non procedural language. Users do not need to ask DBA to establish a special access path for them. The selection of access paths is completed by the optimization mechanism of DBMS.In addition, users can complete data operations without resorting to the loop structure.