article

In computer science, domain relational calculus (DRC) is a calculus that was introduced by Edgar F. Codd as a declarative database query language for the relational data model.

In DRC, queries have the form:

{ | p() }

where each Xi is either a domain variable or constant, and p() denotes a DRC formula. The result of the query is the set of tuples Xi to Xn which makes the DRC formula true.

This language uses the same operators as tuple calculus; Logicial operators ∧ (and), ∨ (or) and ¬ (not). The existential quantifier (∃) and the universal quantifier (∀) can be used to bind the variables.

Examples


Let A, B, C mean Rank, Name, ID and D, E, F to mean Name, DeptName, ID

Find all captains of the starship USS Enterprise:

  • { | in Enterprise ∧ A = "Captain" }
In this example, A, B, C denotes both the result set and a set in the table Enterprise.

Find Names of Enterprise crewmembers who are in Stellar Cartography:

  • { in Enterprise ∧ ∃ D, E, F( in Departments ∧ F = C ∧ E = "Stellar Cartography" ))}
In this example, we're only looking for the name, so

Databases | Data modeling

 

This article is licensed under the GNU Free Documentation License. It uses material from the "Domain relational calculus".

Home Pageartsbusinesscomputersgameshealthhospitalshomekids & teensnewsphysiciansrecreationreferenceregionalscienceshoppingsocietysportsworld