16. 列出員工的年薪資介於420000~520000之間的員工編號、姓名及年薪資(Employees)
mysql> select employeeid ,name,salary from employees where salary between 420000 and 520000;
17. 請用in的方式列出員工代號為1002及1005的部屬烈表,包括:員工編號、姓名、上司的員工編號(Employees)
mysql> select SupervisorID,employeeid ,name,salary from employees where SupervisorID in ('1002','1005');
18. 請用in的方式列出員工姓名’Mary’、’Marua’、’Mike’和’Linda’等人的員工編號、姓名及英文姓名(Employees)
mysql> select SupervisorID,employeeid ,engname,name,salary from employees where engname in ('Mary','marua','mike','linda');
19. 選取部門資料表中所有欄位,並依照DepartmentID作由大到小的排列(Departments)
mysql> select * from departments order by 'departmentid' desc;
20. 列出部門代號、員工編號、姓名及英文姓名,並依照部門代號由小到大及員工編號由小到大的方式排列(Employees)
mysql> select departmentid , employeeid, name,engname from employees order by departmentid , employeeid asc;
沒有留言:
張貼留言