Domain Relational Calculus
Domain Relational Calculus
Many of the calculus expressions involves the use of Quantifiers. There are two
types of quantifiers:
Before using the concept of quantifiers in formulas, we need to know the concept of
Free and Bound Variables.
Free and bound variables may be compared with global and local variable of
programming languages.
Notation:
Where
For example:
Output: This query selects the tuples from the AUTHOR relation. It returns a tuple
with 'name' from Author who has written an article on 'database'.
TRC (tuple relation calculus) can be quantified. In TRC, we can use Existential (∃) and
Universal Quantifiers (∀).
For example:
Output: This query will yield the same result as the previous one.
Notation:
Where
For example:
Output: This query will yield the article, page, and subject from the relational
javatpoint, where the subject is a database.