O (T - COND (T) ) : Name 'Tina'
O (T - COND (T) ) : Name 'Tina'
O (T - COND (T) ) : Name 'Tina'
Retrieval of data
Non procedural Language
a. Specifies what is to be retrieved rather how to retrieve.
Two types
o Tuple Rel. Cal.
o Domain Rel. Cal.
In Domain calculus, instead of having one variable over tuples, the variable range over single
values from domain of attributes.
The general form is {x1, x2, x3, …… xn| COND(x1, x2, x3, …… xn, xn+1, xn+2,….., xn+m)}
Example: Consider a relation STUDENT with five attributes RollNo, Name, Age, Gender and
City
o Display details of student Tina
{ a,b,c,d,e| (STUDENT(a,b,c,d,e) AND b=’Tina’)}
{ a,b,c,d,e| (STUDENT(a,’Tina’,c,d,e) }
o Display rollno and age of tina
{a,b |Student(a,’Tina’,b,c,d,e)}
o Display Name and roll number of student who are 19 years old and from Chennai
{a,b | (ⱻc) (ⱻd) (ⱻe) STUDENT(a,b,c,d,e) AND c=19 AND e=’Chennai’}
EMPLOYEE(SSNo, FirstName, LastName, BDate, Salary, Gender,DeptNo)
DEPARTMENT(DeptNo,DeptName,Location)
RELATIONALCALCULUS
{t | COND(t)} …. Tuple calculus ,,,, t is a variable containg all rows and col
Domain calculus …. Insetad of taling one variable for entire table ,, use different variables for each
attribute
DEPARTMENT(DeptNo,DeptName,Location)
{ b | DEPARTMENT (a,b,’Chennai’)}
Display names of employee who are male and born in the year 1990.
{ b,c| EMPLOYEE(a,b,c,1990,e,’Male’,g) }