domain calculus
   HOME

TheInfoList



OR:

In
computer science Computer science is the study of computation, automation, and information. Computer science spans theoretical disciplines (such as algorithms, theory of computation, information theory, and automation) to practical disciplines (includi ...
, domain relational calculus (DRC) is a calculus that was introduced by Michel Lacroix and Alain Pirotte as a declarative
database query language Query languages, data query languages or database query languages (DQL) are computer languages used to make queries in databases and information systems. A well known example is the Structured Query Language (SQL). Types Broadly, query language ...
for the relational data model.Michel Lacroix, Alain Pirotte
Domain-Oriented Relational Languages
VLDB 1977: 370-378
In DRC, ''queries'' have the form: : \ where each Xi is either a domain variable or constant, and p(\langle X_1, X_2, ...., X_n \rangle) denotes a DRC ''formula''. The result of the query is the set of tuples X1 to Xn that make the DRC formula true. This language uses the same operators as
tuple calculus Tuple calculus is a calculus that was created and introduced by Edgar F. Codd as part of the relational model, in order to provide a declarative database-query language for data manipulation in this data model. It formed the inspiration for the d ...
, the logical connectives ∧ (and), ∨ (or) and ¬ (not). The
existential quantifier In predicate logic, an existential quantification is a type of quantifier, a logical constant which is interpreted as "there exists", "there is at least one", or "for some". It is usually denoted by the logical operator symbol ∃, which, w ...
(∃) and the universal quantifier (∀) can be used to bind the variables. Its computational expressiveness is equivalent to that of
relational algebra In database theory, relational algebra is a theory that uses algebraic structures with a well-founded semantics for modeling data, and defining queries on it. The theory was introduced by Edgar F. Codd. The main application of relational algebr ...
. E. F. Codd
Relational Completeness of Data Base Sub-languages
In R. Rustin, editor, Data Base Systems. Prentice Hall, 1972


Examples

Let (A, B, C) mean (Rank, Name, ID) in the Enterprise relation and let (D, E, F) mean (Name, DeptName, ID) in the Department relation All captains of the starship USS Enterprise: \left\ In this example, A, B, C denotes both the result set and a set in the table Enterprise. Names of Enterprise crew members who are in Stellar Cartography: \begin \ \\ \end In this example, we're only looking for the name, and that's B. The condition F = C is a requirement that describes the intersection of Enterprise crew members AND members of the Stellar Cartography Department. An alternate representation of the previous example would be: \left\ In this example, the value of the requested F domain is directly placed in the formula and the C domain variable is re-used in the query for the existence of a department, since it already holds a crew member's ID.


See also

*
Relational calculus The relational calculus consists of two calculi, the tuple relational calculus and the domain relational calculus, that are part of the relational model for databases and provide a declarative way to specify database queries. The raison d'être ...


References

{{reflist


External links


DES – An educational tool for working with Domain Relational Calculus and other formal languages

WinRDBI – An educational tool for working with Domain Relational Calculus and other formal languages
Relational model Logical calculi