Question related Department to employees ( SQL table design) and queries. Employee Table Columns are id , name , mgr_id ( name is firstname space lastName) Department table looks like name ,head ( where head is mgr_id ) Questions are 1) Write an SQL query to list the full name of every employee, alphabetized by first name. 2)Write an SQL query to list the full name of every employee, alphabetized by last name. 3)Write an SQL query to list the full name of every employee along with the full name of his/her manager. 4)Write an SQL query to list the full name of every employee in the Sales department. 5)Write an SQL query to list the full name of every employee along with name of his/her department. 6)Is there a better design for a database that supports the queries described in questions above? If so, describe it. If not, why not?
Sigiloso
In MySQL, SELECT name FROM employee ORDER BY SUBSTRING_INDEX(name, " ", 1);