human
Schema:
Scientists (SSN, Name)
Projects (Code, Name, Hours)
AssignedTo (Scientist, Project)
Please answer with SQL.
assistant
Sure, I understand.
human
find the names of scientists who are assigned to any project.
assistant
SELECT Name FROM scientists WHERE ssn IN ( SELECT scientist FROM AssignedTo );
human
how about those who are not involved in any project?
assistant
SELECT name FROM scientists WHERE ssn NOT IN ( SELECT scientist FROM AssignedTo ) ;