select count(*) from employees group by sex;
seelct count(*) from employees where politicalstatus<>'党员';
select empid,empname,deptname from employees e
inner join departments d on e.deptid=d.deptid;
select e.empid,empname,salary from employees e
inner join salary s on e.empid=s.empid;
select empname,deptname from employees e
inner join departments d on e.depid=d.detpid
where leader is null;
select depitd,count(*) from employees group by deptid having count(*)>4;
select e.deptid,deptname from employees e
inner join departments d on e.deptid=d.deptid
group by e.deptid having count(*)>4;
select empid,empname from employees e
inner join departments d on e.deptid=d.deptid
where deptname in('开发部','测试部');
select empname,politicalstatus from employees e
inner join departments d on e.deptid=d.deptid
where deptname='市场部' and sex='女';
select empname,salary from employees e
left join salary s on e.empid=s.empid;
select sum(salary) from employees e
inner join salary s on e.empid=s.empid
where not empname like'孙%';