摘要:
MYSQL: select d.dept_no,d.dept_name,count(salary) as sum from departments d join dept_emp de on d.dept_no=de.dept_no join salaries s on de.emp_no=s.em 阅读全文
摘要:
MYSQL: select last_name,first_name,dept_name from employees e left join dept_emp de on e.emp_no=de.emp_no left join departments d on d.dept_no=de.dept 阅读全文
摘要:
MYSQL: select e.emp_no emp_no, s.salary salary, e.last_name last_name, e.first_name first_name from employees e join salaries s on e.emp_no = s.emp_no 阅读全文
摘要:
MYSQL: select emp_no,salary from salaries order by salary desc limit 1,1; 阅读全文
摘要:
MYSQL: select title,avg(salary) from titles join salaries on titles.emp_no=salaries.emp_no GROUP by title order by avg(salary); 阅读全文
摘要:
MYSQL: select * from employees where MOD(emp_no, 2) = 1 and last_name != 'Mary' order by hire_date desc; 阅读全文
摘要:
MYSQL: SELECT X.dept_no,salaries.emp_no,X.maxSalary FROM salaries JOIN dept_emp ON salaries.emp_no=dept_emp.emp_no JOIN (SELECT dept_emp.dept_no,MAX(s 阅读全文
摘要:
MYSQL: select dept_emp.emp_no,dept_manager.emp_no as manager from dept_emp join dept_manager on dept_emp.dept_no=dept_manager.dept_no where dept_emp.e 阅读全文
摘要:
MYSQL: select emp_no from employees where emp_no not IN (select emp_no from dept_manager); 阅读全文
摘要:
MYSQL: select DISTINCT salary from salaries order by salary desc; 阅读全文