Lect 11 Relational Calculus
Lect 11 Relational Calculus
RELATIONAL
CALCULUS
RELATIONAL CALCULUS
Relational Calculus
outputs a new relation
{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).
COMPANY DATABASE
EXAMPLE
To find the first and last names of all employees whose
salary is above $50,000.
Retrieve the name and address of all employees who work for the
‘Research’ department.
Find the names of employees who work on all the projects controlled
by department number 5.
Find the names of employees who work on all the projects controlled
by department number 5.
=========================
AND x.Pnumber=w.Pno))))}
PRACTICE QUERIES
Q1:
Q2:
x.Pnumber = w.Pno))}
Q4:
=========================
Q6: