Guest User

Untitled

a guest
Jan 17th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #The following data definition defines an organization's employee hierarchy.
  2.  
  3. #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.
  4.  
  5. #TABLE employees
  6. # id INTEGER NOT NULL PRIMARY KEY
  7. # managerId INTEGER REFERENCES employees(id)
  8. # name VARCHAR(30) NOT NULL
  9. #Write a query that selects the names of employees who are not managers.
  10. ###############################################################################
  11.  
  12.  
  13. #Answer
  14.  
  15. SELECT name AS [Employess not managers] FROM employees
  16. WHERE managerId is NOT NULL
Add Comment
Please, Sign In to add comment