摘要: 表数据:https://www.cnblogs.com/zhishu/p/16452950.html 1.显示所有员工的姓名,部门号和部门名称。 所有员工,用left join。 left outer join和left join的效果是一样的。 #107条数据,有的员工没有部门 SELECT a. 阅读全文
posted @ 2022-10-17 18:17 植树chen 阅读(84) 评论(0) 推荐(0) 编辑
摘要: 表数据:https://www.cnblogs.com/zhishu/p/16452950.html 1. 查询员工的姓名和部门号和年薪,按年薪降序,按姓名升序显示 SELECT last_name,department_id,salary*12 AS AnnualSalary FROM emplo 阅读全文
posted @ 2022-10-17 14:35 植树chen 阅读(40) 评论(0) 推荐(0) 编辑
摘要: 表数据:https://www.cnblogs.com/zhishu/p/16452950.html 1.选择工资不在5000到12000的员工的姓名和工资 SELECT last_name,salary FROM employees WHERE salary<5000 OR salary>2000 阅读全文
posted @ 2022-10-17 13:57 植树chen 阅读(67) 评论(0) 推荐(0) 编辑
摘要: 表数据:https://www.cnblogs.com/zhishu/p/16452950.html 1.查询员工12个月的工资总和,并起别名为ANNUAL SALARY 别名中有空格的,要用双引号。 IFNULL(expr1,expr2),expr1如果不是null,返回expr1,否则返回exp 阅读全文
posted @ 2022-10-17 10:53 植树chen 阅读(68) 评论(0) 推荐(0) 编辑