Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- An employee is a manager if any other employee has their managerId set to the first employees id. An employee who is a manager may or may not also have a manager.
- TABLE employees
- id INTEGER NOT NULL PRIMARY KEY
- managerId INTEGER REFERENCES employees(id)
- name VARCHAR(30) NOT NULL
- SELECT name
- FROM employees
- where id NOT IN (
- SELECT managerId FROM employees where managerId is not null
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement