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,companyandmanagesrelations, then restrict the results to those tuples where thecompany_names match betweenworksandcompany, theperson_names match betweenworksandmanages, and thecitymatches 'Vancouver', then you can take anyperson_nameandcompany_name, together withmanager_namefrommanages, to make up your result tuple, e.g.:If you wanted to join with
employeefor bothperson_nameandmanager_nameinworks(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.