what's wrong with my query!!
I faced a problem in this query and I hope to get help on it
I have 4 tables which are (model, license, pilot, and person)
Model: mid, name
License: mid, pid, licenseDate
Pilot: pid, hireDate
person: pid, firstName, lastName
I want to get the names of pilots who are not licensed to fly any airplane
I tried this query, but it showed me no result!!!
select model.mid, license.pid, license.mid, license.licenseDate, pilot.pid, pilot.hireDate, person.firstName, person.lastName
from model, license, pilot, person
where pilot.pid = license.pid and model.mid = license.mid and pilot.pid = person.pid
and not exists(SELECT null FROM model WHERE pilot.pid = license.pid);