Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #The following data definition defines an organization's employee hierarchy.
- #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
- #Write a query that selects the names of employees who are not managers.
- ###############################################################################
- #Answer
- SELECT name AS [Employess not managers] FROM employees
- WHERE managerId is NOT NULL
Add Comment
Please, Sign In to add comment