我的broker为什么这么做?# Living
g*r
1 楼
这个面试题是job板上一个同学推荐的。有人能帮忙回答一下吗?
谢谢!
There is an EMPLOYEES(ID, NAME, MANAGER_ID) table. MANAGER_ID points to the
ID column of the same table. Given a manager name (assuming ID is unique and
NAME is unique), what kind of SQL query would you write to retrieve all
employees directly managed by this manager? What is the query to get
employees 2 levels down? Is there a way to write a query to get employees N
levels down? Is there another way of organising this table (different
columns?) to hold these kinds of tree structures?
谢谢!
There is an EMPLOYEES(ID, NAME, MANAGER_ID) table. MANAGER_ID points to the
ID column of the same table. Given a manager name (assuming ID is unique and
NAME is unique), what kind of SQL query would you write to retrieve all
employees directly managed by this manager? What is the query to get
employees 2 levels down? Is there a way to write a query to get employees N
levels down? Is there another way of organising this table (different
columns?) to hold these kinds of tree structures?