EMPLOYEES, 有四个字段,EMPLOYEE_ID:员工表(主键)、DEPT_ID:部门号、EMPLOYEE_NAME:员工姓名、EMPLOYEE_SALARY:员工工资。
建表语句
CREATE TABLE EMPLOYEES(
EMPLOYEE_ID int not null primary key,
DEPT_ID int,
EMPLOYEE_NAME char(40),
EMPLOYEE_SALARY double
);
检索出员工工资最高的员工姓名和工资
select * from employee where employee. salary= (select max(employee_salary) from employee)
检索出部门中员工最多的部门号和此部门员工数量
select dept_id,count(*) cno from user GROUP BY dept_id desc limit 1