CS3402 Database Systems Tutorials
CS3402 Tutorial 6:
1. Consider the two tables T1 and T2 shown below; show the results of the following operations.
T1 T2
(a) T1 × T2
(b) T1 ⋈!”.$%!&.’T2
(c) T1 ⋈!”.(%!&.)T2
(d) T1 ⋈!”.*+!&.*T2
(e) T1 ∗ T2
2. Consider the COMPANY relational schema shown below; specify the following queries in relational algebra.
(a) Find the SSn (social security number) of all employees who are not supervisors
(b) Find the SSn of all employees who either work in department 5 or directly
supervise an employee who works in department 5
(c) List the names and numbers of all departments locating in ‘Houston’
(d) List the first names of all employees who have a dependent with the same first
name as themselves
(e) Retrieve the salary of all employees in department 5 who work more than 10
hours on the project named ‘ProjectX’
P
Q
R
10
a
5
15
b
8
25
a
6
A
B
R
10
b
6
25
c
3
10
b
5