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?
3 DB questions
What id the difference between clustered and non clustered index?
What is the difference between \'having\' and \'where\'
What is query optimization??
Write a one line SQL statement that will give you a count of all rows in xyztable that have names with digits in them, but emails that contain only letters. xyztable contains two fields of type varchar(255): name and email.