6.11 考虑图6-22所示关系数据库,主码加了下划线。给出关系代数表达式来表示下列的每一个查询:
找出 First Bank Corporation的所有员工姓名。
1
2
3select person_name
from works
where company_name = 'First Bank Corporation';找出 First Bank Corporation所有员工的姓名和居住城市。
1
2
3
4select e.person_name, e.city
from works w, employee e
where e.person_name = w.person_name
and w.company_name = 'First Bank Corporation';找出 First Bank Corporation所有年收入在10000美元以上的员工姓名和居住的街道、城市。
1
2
3select e.person_name, e.street, e.city
from works w, employee e
where e.person_name = w.person_name and w.salary > 10000 and w.company_name = 'First Bank Corporation';找出所有居住地与工作的城市在同一个城市的员工姓名。
1
2
3select e.person_name
from works w, employee e
where e.person_name = w.person_name and e.city = w.city;假设公司可以位于几个城市之中。找出满足下面条件的所有公司,它位于Small Bank Corporation所位于的每一个城市。
1
2
3select A.company_name
from company A , company B
where B.company_name = 'Small Bank Corporation' and A.city = B.city;