Google

Relational Calculus

Overview

- non procedural formal data manipulation language
- user needs to tell WHAT to do and not HOW to do
- alternate std for relational DML
- Not related to differential or integral calculus but derives its name from symbolic logic called predicate calculus

Two type of Relational Calculus:

a) Tuple Oriented
- Primarily, interested in finding relation tuples for which a predicate is true
- Required is a Tuple variable: variable that takes only the tuples of some relation or relations as its range of values
- corresponds to mathematical domain
- e,g, Range of S is STUDENT then,
   S --> Tuple variable
   STUDENT  --> range
therefore, S always represent a Tuple of student expressed as
{S|P(S)} --> set of all tuples S such that P(S) is true where P implies predicate condition

{R|R. Credits>50} i.e. Find studId, studName,  major of all students with credits > 50

b) Domain Oriented
- use variables that take values from domain instead of Tuple of relations
- if P(x1, x2,...,xn) stands for predicate with variables x1...xn then
{|P(x1.,,,xn)}
Means the set of all domain variables x1,.., xn for which predicate P(x1...xn) is true

We test for membership condition to determine whether values belong to relation or not