Hubbry Logo
search button
Sign in
Domain relational calculus
Domain relational calculus
Comunity Hub
History
arrow-down
starMore
arrow-down
bob

Bob

Have a question related to this hub?

bob

Alice

Got something to say related to this hub?
Share it here.

#general is a chat channel to discuss anything related to the hub.
Hubbry Logo
search button
Sign in
Domain relational calculus
Community hub for the Wikipedia article
logoWikipedian hub
Welcome to the community hub built on top of the Domain relational calculus Wikipedia article. Here, you can discuss, collect, and organize anything related to Domain relational calculus. The purpose of t...
Add your contribution
Domain relational calculus

In computer science, domain relational calculus (DRC) is a calculus that was introduced by Michel Lacroix and Alain Pirotte as a declarative database query language for the relational data model.[1]

In DRC, queries have the form:

where each Xi is either a domain variable or constant, and 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, 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.[2]

Examples

[edit]

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.

Both of them written in SQL will be like:

SELECT B
FROM Enterprise
JOIN Department
  ON F = C
 AND E = 'Stellar Cartography';

See also

[edit]

References

[edit]
  1. ^ Lacroix, Michel; Pirotte, Alain (1977-10-06). "Domain-oriented relational languages". Proceedings of the third international conference on Very large data bases - Volume 3. VLDB '77. Tokyo, Japan: VLDB Endowment: 370–378.
  2. ^ E. F. Codd: Relational Completeness of Data Base Sub-languages. In R. Rustin, editor, Data Base Systems. Prentice Hall, 1972
[edit]