I tried with the following query to get department name but not achieving completely.
(我尝试使用以下查询获取部门名称,但未完全实现。)
select Dep_name as dept_name
from salary
group by Dep_name
order by avg_salary desc
limit 1;
the table looks like
(桌子看起来像)
emp_id Dep_name salary
34 Marketing 35000
35 Sales 48000
36 Admin 23000
37 Sales 67000
38 Sales 97000
39 Marketing 98000
40 Admin 57000
41 Admin 71000
42 Marketing 80000
getting output as 'Sales' ie highest Avg_salary among the departments
(获得“销售”输出,即部门中最高的平均工资)
I guess the output should be 'Marketing'
(我猜输出应该是“营销”)
ask by Yashaswini Ravi translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…