2018年 北京某公司面试题

从员工表t₁和部门表t₂中选择所有字段及t₂的经理。
其中条件为:t₁的部门编号等于t₂的部门号码。
并且不存在另一个部门员工关系满足该员工为其他人的经理。
部门编号作为主键选择部门编号、性别以及员工数量字段,并根据部门编号和性别进行分组统计
左连接的部门表中选择部门编号以及计算员工年龄的平均值;从部门表dt左连接员工业表emp按照部门编号相等进行查询;然后根据部门编号分组
选择部门编号及最低工资
来自部门表t1和员工表t2进行左连接
与工资表t3在员工编号和项目上进行匹配
按照部门编号分组即可
retrieve all records from (
select
deptno,
*
as num,
row number assigned to each record within the partitioned group ordered by money descending
from dept via t1
left join employee via t2
left join wage on (empno, item) equals 'saraly'
) as temp table where num <= 3 order by deptno, num desc
6
select unique empno, wage from t
where item is 'Late'
and countDate exceeds the next month's cutoff date
Adjust the salary for employees whose pay item is to be set at 450. This adjustment applies exclusively to employees with a pay item designated as 'Bonus' and whose employee numbers are among those of department managers.
算法题
