You are on page 1of 5

Write Relation Algebra for the given

situation.

29-May-2014

GIVEN SITUATION-1
To select the EMPLOYEE tuples whose
department number is four or those
whose salary is greater than $30,000
the following notation is used

(DNO=4) OR (salaray >30,000)

(Employee)

GIVEN SITUATION-2
To retrieve the first name, last name,
and salary of all employees who work
in department number 5, we must
apply a select and a project
operation. We can write a single
relational algebra expression as
follows:

firstname, lastname, salary

(EMPLOYEE))

dno=5

GIVEN SITUATION-3
Select the st_id, st_name, st_grade
from STUDENT table for all those
students whose st_id is between 100
and 200 and their grade is A or for all
those students whose st_id less than
50 and have B or C grade.
st_id, st_name, st_grade ( ((st_id >=100 AND st_id<=200)
AND grade = A) OR (st_id <50 AND (grade = B OR grade =
C))

(STUDENT))

GIVEN SITUATION-3
students whose st_id is between 100
and 200 and their grade is A
or
for all those students whose st_id
less than 50 and have B or C grade.
st_id, st_name, st_grade ( ((st_id >=100 AND st_id<=200)
AND grade = A) OR (st_id <50 AND (grade = B OR grade =
C))

(STUDENT))

You might also like