explain following info in simple terms and in depth 
Relational Calculus

A relational calculus expression creates a new relation,
specified in terms of variables that range over
(i) rows of the stored database relations (in tuple calculus) or
(ii) columns of the stored relations (in domain calculus)

- no order of operations to specify how to retrieve the query result
- only spcifies what information the results should contain

Tuple Relational Calculus

• Based on specifying a number of tuple variables.
• Each tuple variable usually ranges over a particular database relation, meaning
that the variable may take as its value any individual tuple from that relation
• A simple tuple relational calculus query is of the form

{t | COND(t)}

• where t is a tuple variable and COND (t) is a conditional expression involving t.
• The result of such a query is the set of all tuples t that satisfy COND (t).

Tuple Relational Calculus

• Example: To find the first and last names of all employees whose
salary is above $50,000, we can write the following tuple calculus
expression:

{t.FNAME, t.LNAME | EMPLOYEE(t) AND t.SALARY>50000}

The Existential and Universal Quantifiers

• Two special symbols called quantifiers can appear in formulas; these are the
universal quantifier (") and the existential quantifier ($)

• Informally, a tuple variable t is bound if it is quantified, meaning that it appears in
an (" t) or ($ t) clause; otherwise, it is free.

• If F is a formula, then so are ($ t)(F) and (" t)(F), where t is a tuple variable.
• The formula ($ t)(F) is true if the formula F evaluates to true for some (at least one)
tuple assigned to free occurrences of t in F; otherwise ($ t)(F) is false.

• The formula (" t)(F) is true if the formula F evaluates to true for every tuple (in the
universe) assigned to free occurrences of t in F; otherwise (" t)(F) is false.

Example

• Retrieve the name and address of all employees who work for the ‘Research’ department. The
query can be expressed as :

{t.FNAME, t.LNAME, t.ADDRESS | EMPLOYEE(t) and ($ d)
(DEPARTMENT(d) and d.DNAME=‘Research’ and d.DNUMBER=t.DNO) }

• The only free tuple variables in a relational calculus expression should be those that appear to the
left of the bar ( | ).
• In above query, t is the only free variable; it is then bound successively to each tuple.

Domain Relational Calculus

• The language called QBE (Query-By-Example) that is related to domain calculus
was developed almost concurrently to SQL at IBM Research, Yorktown Heights,
New York.
• Domain calculus was thought of as a way to explain what QBE does.

• Domain calculus differs from tuple calculus in the type of variables used in
formulas:
• Rather than having variables range over tuples, the variables range over
single values from domains of attributes.

• To form a relation of degree n for a query result, we must have n of these domain
variables— one for each attribute.

Domain Relational Calculus

• An expression of the domain calculus is of the form
{ x1, x2, . . ., xn | COND(x1, x2, . . ., xn, xn+1, xn+2, . . ., xn+m)}

• where x1, x2, . . ., xn, xn+1, xn+2, . . ., xn+m are domain variables that range over
domains (of attributes)
• and COND is a condition or formula of the domain relational calculus.

Example

• Retrieve the birthdate and address of the employee whose name is ‘John B. Smith’.
• Query :
{uv | ($ q) ($ r) ($ s) ($ t) ($ w) ($ x) ($ y) ($ z)
(EMPLOYEE(qrstuvwxyz) and q=’John’ and r=’B’ and s=’Smith’)}
• Ten variables for the employee relation are needed, one to range over the domain of each
attribute in order.
• Of the ten variables q, r, s, . . ., z, only u and v are free.
• Specify the requested attributes, BDATE and ADDRESS, by the free domain variables u for BDATE
and v for ADDRESS.
• Specify the condition for selecting a tuple following the bar ( | )—
• namely, that the sequence of values assigned to the variables qrstuvwxyz be a tuple of the
employee relation and that the values for q (FNAME), r (MINIT), and s (LNAME) be ‘John’, ‘B’,
and ‘Smith’, respectively.