Вопрос: Укажите имя сотрудника как «staff_member» и имя руководителя в качестве «supervisor» для всех сотрудников, которые не живут в том же городе, что и их руководитель.
Отношения:
Staff (Snum, Name, DOB, Address, City, Gender, Salary, Supervisor,Dnum)
Dept ( Dnum, Dname, Manager, Mgrstartdate )
Deptlocation ( Dnum, Dcity )
Project ( Pnum, Pname, Pcity, Dnum )
Workson ( Snum, Pnum, Hours )
Column Supervisor of table Staff is a foreign key which references column Snum of table Staff.
Column Dnum of table Staff is a foreign key which references column Dnum of table Dept.
Column Manager of table Dept is a foreign key which references column Snum of table Staff.
Column Dnum of table Deptlocation is a foreign key which references column Dnum of table Dept.
Column Dnum of table Project is a foreign key which references column Dnum of table Dept.
Column Snum of table Workson is a foreign key which references column Snum of table Staff.
Column Pnum of table Workson is a foreign key which references column Pnum of table Project.
Что я получил так далеко:
SELECT name AS staff_member, supervisor
from staff s
INNER JOIN deptlocation d ON s.dnum = d.dnum
WHERE s.city NOT EXISTS (d.city)
Что я делаю не так?
Error:Your query has syntax errors.
Description:java.sql.SQLException: ORA-00920: invalid relational operator