You are on page 1of 2

Department of Computer Science

1501263 Intro. to Database Management Systems


Fall 2021-2022

iTBL 4-B
Write the following queries in relational algebra:

 Retrieve the Lname and Ssn of all employees in the Finance department.

Temp1 EMPLOYEE ∞ Dno= number (Department)

Temp2 Ϭ Dname= ‘Finance’ (Temp1)

Result ∏ Lname,Ssn (Temp2)

 Retrieve the Ssn of employess whose salary is greater than 40000 but does not work for the Research department.

Temp1 ∏ SSn ( Ϭsalary>40000 (EMPLOYEE))

Temp2 ϬDname=”Research” (EMPLOYEE ∞ Dno= number (Department))

Temp3 ∏Ssn (Temp2 )

Result Temp1-Temp3
Department of Computer Science
1501263 Intro. to Database Management Systems
Fall 2021-2022

You might also like