sql語句之分組,聚合函式

weixin_34050427發表於2017-11-22

1.背景:作為一名測試工程師,sql語句也是必備技能,剛好前兩天朋友的面試題做為列子簡單做下筆記

2.question:

7310275-7c4c166d87f0cddb.png

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

~還有左聯、外聯、跨表聯

相關文章