Find the names, company names, and the manager names of all employees who work for a company located in the city of Vancouver.
How to write this in Tuple Relational Calculus? I have been thinking this for a long time. Whenever it goes to "manages", I don't know how to deal with the manages.manager_name to employee.person_name
If you take the cartesian product of all tuples in the
works
,company
andmanages
relations, then restrict the results to those tuples where thecompany_name
s match betweenworks
andcompany
, theperson_name
s match betweenworks
andmanages
, and thecity
matches 'Vancouver', then you can take anyperson_name
andcompany_name
, together withmanager_name
frommanages
, to make up your result tuple, e.g.:If you wanted to join with
employee
for bothperson_name
andmanager_name
inworks
(even though it would be redundant), then you could do so:Hope that makes sense, it's been a while and I had to look it up.