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 (includin ...
, domain relational calculus (DRC) is a calculus that was introduced by Michel Lacroix and
Alain Pirotte Alain may refer to:
People
* Alain (given name), common given name, including list of persons and fictional characters with the name
* Alain (surname)
* "Alain", a pseudonym for cartoonist Daniel Brustlein
* Alain, a standard author abbreviation u ...
as a
declarative database query language for the
relational data model
The relational model (RM) is an approach to managing data using a structure and language consistent with first-order predicate logic, first described in 1969 by English computer scientist Edgar F. Codd, where all data is represented in terms of ...
.
[Michel Lacroix, Alain Pirotte]
Domain-Oriented Relational Languages
VLDB 1977: 370-378
In DRC, ''queries'' have the form:
:
where each X
i is either a domain variable or constant, and
denotes a DRC ''formula''. The result of the query is the set of tuples X
1 to X
n that make the DRC formula true.
This language uses the same operators as
tuple calculus,
the logical connectives ∧ (and), ∨ (or) and ¬ (not). The
existential quantifier (∃) and the
universal quantifier (∀) can be used to bind the variables.
Its computational expressiveness is equivalent to that of
relational algebra.
[ 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:
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:
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:
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
The relational model (RM) is an approach to managing data using a Structure (mathematical ...
References
{{reflist
External links
DES – An educational tool for working with Domain Relational Calculus and other formal languagesWinRDBI – An educational tool for working with Domain Relational Calculus and other formal languages
Relational model
Logical calculi