列出本世纪出生的收入超过$50000的雇员。列出他们的名字,出生日期和薪水,按名字的字母顺序排列。
SELECT employee_name, date_of_birth, salary FROM employees WHERE salary > 50000 AND date_of_birth >= DATE '2000-01-01' ORDER BY employee_name;
显示每个部门至少有5名员工的员工人数。首先列出最大的部门。
SELECT department_id, COUNT(*) FROM employees GROUP BY department_id HAVING COUNT(*) >= 5 ORDER BY COUNT(*) DESC;