sql语句之分组,聚合函数

1.背景:作为一名测试工程师,sql语句也是必备技能,刚好前两天朋友的面试题做为列子简单做下笔记

2.question:

sql语句之分组,聚合函数_第1张图片

3.answer:

1)update employee set salary=salary+200 where age>=40 and salary<2000

2)select distinct depart.name,count(depart.id) as m from depart ,employee,DE where employee.ID=DE.eid and depart.id=DE.did and employee.age>=40 and employee.salary<2200 GROUP BY(depart.name) order by  m

4.提示:个人觉得sql语句并不难,格外要注意的是各个语句的执行顺序,推荐大家看下这篇博客写的很详细

https://www.cnblogs.com/ghost-xyx/p/3811036.html

~还有左联、外联、跨表联

你可能感兴趣的:(sql语句之分组,聚合函数)